# Get returns a cluster by server address

`GET /api/v1/clusters/{id.value}`

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: apiKey, header Authorization. A token sent as `Authorization: Bearer <token>`. [API Docs](https://sourcey-argocd.pages.dev/developer-guide/api-docs/index.md#authorization) shows how to get one.

Parameters:

- `id.value` (path, string, required) - value holds the cluster server URL or cluster name
  Type: string

- `server` (query, string, optional)
  Type: string

- `name` (query, string, optional)
  Type: string

- `id.type` (query, string, optional) - type is the type of the specified cluster identifier ( "server" - default, "name" ).
  Type: string

Responses:

- 200: A successful response.

Content type: application/json

Type: object

Schema: [v1alpha1Cluster](https://sourcey-argocd.pages.dev/api/models/v1alpha1cluster/index.md)

- `annotations` (optional)
  Type: object
  
  Additional properties: 
    Type: string

- `clusterResources` (optional)
  Type: boolean
  
  Indicates if cluster level resources should be managed. This setting is used only if cluster is connected in a namespaced mode.

- `config` (optional)
  Reference: [v1alpha1ClusterConfig](https://sourcey-argocd.pages.dev/api/models/v1alpha1clusterconfig/index.md); Type: object
  
  ClusterConfig is the configuration attributes. This structure is subset of the go-client
  rest.Config with annotations added for marshalling.

- `configHash` (optional)
  Type: string, uint64

- `connectionState` (optional)
  Reference: [v1alpha1ConnectionState](https://sourcey-argocd.pages.dev/api/models/v1alpha1connectionstate/index.md); Type: object

- `info` (optional)
  Reference: [v1alpha1ClusterInfo](https://sourcey-argocd.pages.dev/api/models/v1alpha1clusterinfo/index.md); Type: object

- `labels` (optional)
  Type: object
  
  Additional properties: 
    Type: string

- `name` (optional)
  Type: string

- `namespaces` (optional)
  Type: array
  
  Holds list of namespaces which are accessible in that cluster. Cluster level resources will be ignored if namespace list is not empty.
  
  Items:
    Type: string

- `project` (optional)
  Type: string

- `refreshRequestedAt` (optional)
  Reference: [v1Time](https://sourcey-argocd.pages.dev/api/models/v1time/index.md); Type: string, date-time
  
  Time is a wrapper around time.Time which supports correct
  marshaling to YAML and JSON.  Wrappers are provided for many
  of the factory methods that the time package offers.
  
  +protobuf.options.marshal=false
  +protobuf.as=Timestamp
  +protobuf.options.(gogoproto.goproto_stringer)=false

- `server` (optional)
  Type: string

- `serverVersion` (optional)
  Type: string

- `shard` (optional)
  Type: integer, int64
  
  Shard contains optional shard number. Calculated on the fly by the application controller if not specified.

- default: An unexpected error response.

Content type: application/json

Type: object

Schema: [runtimeError](https://sourcey-argocd.pages.dev/api/models/runtimeerror/index.md)

- `code` (optional)
  Type: integer, int32

- `details` (optional)
  Type: array
  
  Items:
    Reference: [protobufAny](https://sourcey-argocd.pages.dev/api/models/protobufany/index.md); Type: object

- `error` (optional)
  Type: string

- `message` (optional)
  Type: string

## Examples

### cURL

```bash
curl -X GET 'https://argocd.example.com/api/v1/clusters/string' \
  -H 'Authorization: YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://argocd.example.com/api/v1/clusters/string', {
  method: 'GET',
  headers: {
    'Authorization': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://argocd.example.com/api/v1/clusters/string',
    headers={
        'Authorization': 'YOUR_TOKEN',
    },
)
print(response.text)
```
