get network.md
Get Network
Infra API · Networks
GET https://app.mk.io/api/v1/projects/{project_name}/infra/networks/{name}
Get a network by name. To learn more about networks, read Network Concept.
RBAC Capability Required: infra.network.get
Authentication
Authorizationheader — Bearer authentication of the formBearer <token>.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
project_name |
string | Yes | — |
name |
string | Yes | — |
Example request
curl -X GET "https://app.mk.io/api/v1/projects/{project_name}/infra/networks/{name}" \
-H "Authorization: Bearer <token>"
Responses
200 — A single Network
kind· string · Required — The kind of record.metadata· object · Required — Network metadata.created· string · Optional · format: date-time — The time when the resource was createdcreatedBy· string · Optional · format: uuid — ID of the user who created the resourcecreatedByEmail· string · Optional — Email of the user who created the resourcedisplayName· string · Optional — The display name of the resourceid· string · Required · format: uuid — The ID of the resourcelabels· map from strings to string · Optional — A dictionary of labels associated with the resource[any key]· string — map of additional properties
name· string · Optional — The name of the resourceupdated· string · Optional · format: date-time — The time when the resource was last updatedupdatedBy· string · Optional · format: uuid — ID of the user who last updated the resourceupdatedByEmail· string · Optional — Email of the user who last updated the resource
spec· object · Required — Network specification.status· object · Required — Network status.owner· enum · Required — Indicates whether the network was automatically created by the system. System owned networks cannot be deleted, but they can be modified. To learn more, read System owned networks.- Allowed values:
User,System
- Allowed values:
scope· enum · Required — Indicates whether the network is a local network within a site. Local networks are always system owned and therefore cannot be deleted, however they can be modified.- Allowed values:
Connecting,Local
- Allowed values:
Example:
{
"kind": "string",
"metadata": {
"created": "2024-01-01T00:00:00Z",
"createdBy": "00000000-0000-0000-0000-000000000000",
"createdByEmail": "string",
"displayName": "string",
"id": "00000000-0000-0000-0000-000000000000",
"labels": {
"label1": "value1",
"label2": "value2"
},
"name": "string",
"updated": "2024-01-01T00:00:00Z",
"updatedBy": "00000000-0000-0000-0000-000000000000",
"updatedByEmail": "string"
},
"spec": {},
"status": {
"owner": "User",
"scope": "Connecting"
}
}
400 — Bad Request
error· object · Required — Pertinent information about the errorcode· string · Required — The error code.detail· string · Required — The error message.extraDetail· map from strings to any · Optional — Extra information regarding this error.[any key]· any — map of additional properties
ref· string · Required — A reference to the request that caused the error.status· integer · Required — The HTTP status code
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
401 — Unauthorized
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
403 — Forbidden
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
404 — Not Found
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
429 — Too Many Requests
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
500 — Internal Server Error
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}