Departments

Departments, in the hierarchy of resource allocation, are above Projects. A Department can contain multiple Projects, and has its own quotas. A Department's quota supersedes the total of the Project quotas in the Department, so tt is recommended that a Department's quota be the total, or more than of all the Project quotas in the Department. For further information see, Working with Departments.

Create department

Create Department

SecuritybearerAuth
Request
Request Body schema: application/json
required

Department to create.

required
Array of objects (Resources)

Resources assigned to this Organization per Node Pool

name
required
string
clusterId
required
string <uuid> (ClusterId)

The id of the cluster.

Responses
201

Created

400

Bad request.

401

Unauthorized

403

Forbidden

503

unexpected error

post/api/v1/org-unit/departments
Request samples
application/json
{
  • "resources": [
    ],
  • "name": "organization1",
  • "clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210"
}
Response samples
application/json
{
  • "resources": [
    ],
  • "name": "organization1",
  • "clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
  • "id": 50,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedBy": "string",
  • "children": [
    ],
  • "projectsAggregatedResources": [
    ],
  • "status": {
    }
}

Get departments

list departments

SecuritybearerAuth
Request
query Parameters
filterBy
Array of strings

Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contains, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.

Example: filterBy=name!=some-name
sortBy
string

Sort results by a parameters.

Enum: "name" "clusterId" "createdAt"
sortOrder
string
Default: "asc"

Sort results in descending or ascending order.

Enum: "asc" "desc"
offset
integer <int32>

The offset of the first item returned in the collection.

Example: offset=100
limit
integer <int32> [ 1 .. 500 ]
Default: 50

The maximum number of entries to return.

Responses
200

ok

400

Bad request.

401

Unauthorized

403

Forbidden

503

unexpected error

get/api/v1/org-unit/departments
Response samples
application/json
{
  • "departments": [
    ],
  • "next": 1
}

Update department

Update department by Id

SecuritybearerAuth
Request
path Parameters
departmentId
required
string

The id of the department.

Example: 1
Request Body schema: application/json
required

Department to update.

required
Array of objects (Resources)

Resources assigned to this Organization per Node Pool

Responses
200

Updated

400

Bad request.

401

Unauthorized

403

Forbidden

404

The specified resource was not found

503

unexpected error

put/api/v1/org-unit/departments/{departmentId}
Request samples
application/json
{
  • "resources": [
    ]
}
Response samples
application/json
{
  • "resources": [
    ],
  • "name": "organization1",
  • "clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
  • "id": 50,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedBy": "string",
  • "children": [
    ],
  • "projectsAggregatedResources": [
    ],
  • "status": {
    }
}

Get department

Get department by Id

SecuritybearerAuth
Request
path Parameters
departmentId
required
string

The id of the department.

Example: 1
Responses
200

ok

401

Unauthorized

403

Forbidden

404

The specified resource was not found

503

unexpected error

get/api/v1/org-unit/departments/{departmentId}
Response samples
application/json
{
  • "resources": [
    ],
  • "name": "organization1",
  • "clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
  • "id": 50,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedBy": "string",
  • "children": [
    ],
  • "projectsAggregatedResources": [
    ],
  • "status": {
    }
}

Delete department

Delete department by Id

SecuritybearerAuth
Request
path Parameters
departmentId
required
string

The id of the department.

Example: 1
Responses
204

Deleted

400

Bad request.

401

Unauthorized

403

Forbidden

404

The specified resource was not found

503

unexpected error

delete/api/v1/org-unit/departments/{departmentId}
Response samples
application/json
{
  • "code": 400,
  • "message": "Required parameter is missing"
}

Update department resources

Update department resources by Id

SecuritybearerAuth
Request
path Parameters
departmentId
required
string

The id of the department.

Example: 1
Request Body schema: application/json
required

Department resources to update.

Array
object or null

the node pool which the resources refer to

required
object

GPU number to the project in the node pool

object or null

CPU in Millicores to the project in the node pool

object or null

Memory to the project in the node pool

Responses
200

Updated

400

Bad request.

401

Unauthorized

403

Forbidden

404

The specified resource was not found

500

unexpected error

503

unexpected error

put/api/v1/org-unit/departments/{departmentId}/resources
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
[
  • {
    }
]

Patch department resources

Partial updates to specific items in the list. Should be used for update one or more attributes of an item without modifying the entire resource.

SecuritybearerAuth
Request
path Parameters
departmentId
required
string

The id of the department.

Example: 1
Request Body schema: application/json
required

Department resources to update.

Array
object or null

the node pool which the resources refer to

required
object

GPU number to the project in the node pool

object or null

CPU in Millicores to the project in the node pool

object or null

Memory to the project in the node pool

Responses
200

Updated

400

Bad request.

401

Unauthorized

403

Forbidden

404

The specified resource was not found

500

unexpected error

503

unexpected error

patch/api/v1/org-unit/departments/{departmentId}/resources
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
[
  • {
    }
]

Get metrics for all departments.Deprecated

Get metrics for all departments in the cluster. Use a time range to return historical data (optional). If you use a start date, an end date is required.

SecuritybearerAuth
Request
path Parameters
clusterUuid
required
string <uuid> non-empty

The Universally Unique Identifier (UUID) of the cluster.

Example: 9f55255e-11ed-47c7-acef-fc4054768dbc
query Parameters
start
string <date-time>

Start of time range to fetch data from in UTC format.

Example: start=2023-06-06 12:09:18.211
end
string <date-time>

End of time range to fetch data from in UTC format.

Example: end=2023-06-07 12:09:18.211
numberOfSamples
integer [ 0 .. 1000 ]
Default: 20

The number of samples to take in the specified time range.

Example: numberOfSamples=20
nodepoolName
string

Filter by unique nodepool name.

Example: nodepoolName=default
Responses
200

Successfully retrieved metrics for all departments.

401

Unauthorized

403

Forbidden

404

The specified resource was not found

500

unexpected error

503

unexpected error

get/v1/k8s/clusters/{clusterUuid}/departments/metrics
Response samples
application/json
{
  • "data": [
    ],
  • "timeRange": {
    }
}

Get metrics for a specific department.Deprecated

Get metrics for a specific department in the cluster. Use a time range to return historical data (optional). If you use a start date, an end date is required.

SecuritybearerAuth
Request
path Parameters
clusterUuid
required
string <uuid> non-empty

The Universally Unique Identifier (UUID) of the cluster.

Example: 9f55255e-11ed-47c7-acef-fc4054768dbc
departmentId
required
string

The id of the department.

Example: 1
query Parameters
start
string <date-time>

Start of time range to fetch data from in UTC format.

Example: start=2023-06-06 12:09:18.211
end
string <date-time>

End of time range to fetch data from in UTC format.

Example: end=2023-06-07 12:09:18.211
numberOfSamples
integer [ 0 .. 1000 ]
Default: 20

The number of samples to take in the specified time range.

Example: numberOfSamples=20
nodepoolName
string

Filter by unique nodepool name.

Example: nodepoolName=default
Responses
200

Successfully retrieved metrics for the department.

401

Unauthorized

403

Forbidden

404

The specified resource was not found

500

unexpected error

503

unexpected error

get/v1/k8s/clusters/{clusterUuid}/departments/{departmentId}/metrics
Response samples
application/json
{
  • "metadata": {
    },
  • "current": {
    },
  • "timeRange": {
    }
}

Get a specific department.Deprecated

Retrieves the details of a specific department. Requires theview permission for the department.

SecuritybearerAuth
Request
path Parameters
clusterId
required
string

The Universally Unique Identifier (UUID) of the cluster.

Example: 9f55255e-11ed-47c7-acef-fc4054768dbc
department-id
required
integer

The unique id of the department.

Example: 2
query Parameters
excludePermissions
boolean

backwards compatibility of the 'departmentAdmins' field. if 'true', will not set the 'departmentAdmins' field in the returned department. if 'false', will set the 'departmentAdmins' field in the returned department.

Example: excludePermissions=true
Responses
200

Successfully retrieved department details.

get/v1/k8s/clusters/{clusterId}/departments/{department-id}
Response samples
application/json
{
  • "name": "default",
  • "deservedGpus": 2,
  • "allowOverQuota": false,
  • "maxAllowedGpus": 2,
  • "resources": {
    }
}

Update a department.Deprecated

Updates a department's details in the cluster. \n For example, node pools and other details.

SecuritybearerAuth
Request
path Parameters
clusterId
required
string

The unique uuid identifying the cluster.

Example: 9f55255e-11ed-47c7-acef-fc4054768dbc
department-id
required
integer

The unique id identifying the department.

Example: 2
Request Body schema: application/json
required
Array of objects (NodePoolAssignedResources)

Resources assigned to this Department per Node Pool

name
required
string

The name of the department.

deservedGpus
number
Deprecated

Deprecated. Instead, use deserved for the relevant resource type under NodePoolResources. Deserved GPUs for the department.

allowOverQuota
boolean
Deprecated

Deprecated. Instead, use maxAllowed for the relevant resource type under NodePoolResources. Is over quota allowed for the department.

maxAllowedGpus
number
Deprecated

Deprecated. Instead, use maxAllowed for the relevant resource type under NodePoolResources. Max allowed GPUs for the department.

object
Deprecated

Deprecated. Instead, use 'nodePoolsResources'. Total resources assigned to the Department. Can only be used in PUT/POST when there is a single Node Pool in the system. The resources returned in GET are the sum of all Node Pool Resources.

Responses
200

Department updated successfully.

put/v1/k8s/clusters/{clusterId}/departments/{department-id}
Request samples
application/json
{
  • "nodePoolsResources": [
    ],
  • "name": "default",
  • "deservedGpus": 2,
  • "allowOverQuota": false,
  • "maxAllowedGpus": 2,
  • "resources": {
    }
}
Response samples
application/json
{
  • "name": "default",
  • "deservedGpus": 2,
  • "allowOverQuota": false,
  • "maxAllowedGpus": 2,
  • "resources": {
    }
}

Delete a department.Deprecated

Deletes a department from a specific cluster.

SecuritybearerAuth
Request
path Parameters
clusterId
required
string

The unique uuid identifying the cluster.

Example: 9f55255e-11ed-47c7-acef-fc4054768dbc
department-id
required
integer

The unique id identifying the department.

Example: 2
Responses
200

Department deleted successfully.

delete/v1/k8s/clusters/{clusterId}/departments/{department-id}
Response samples
application/json
{
  • "name": "default",
  • "deservedGpus": 2,
  • "allowOverQuota": false,
  • "maxAllowedGpus": 2,
  • "resources": {
    }
}

List all departments.Deprecated

List all the departments managed by the tenant on a specific cluster.

SecuritybearerAuth
Request
path Parameters
clusterId
required
string

The Universally Unique Identifier (UUID) of the cluster.

Example: 9f55255e-11ed-47c7-acef-fc4054768dbc
query Parameters
excludePermissions
boolean

Backward compatibility of the departmentAdmins field. If true, the departmentAdmins field in the returned departments is not set. If false, the departmentAdmins is set in the returned departments.

Example: excludePermissions=true
memoryUnitMb
boolean

Memory returned in MB. When set to false (default) memory will be returned in MiB.

Example: memoryUnitMb=true
Responses
200

Successfully retrieved a list of Departments.

get/v1/k8s/clusters/{clusterId}/departments
Response samples
application/json
[
  • {
    }
]

Create a new department.Deprecated

Creates a new department in the cluster.

SecuritybearerAuth
Request
path Parameters
clusterId
required
string

The unique uuid identifying the cluster.

Example: 9f55255e-11ed-47c7-acef-fc4054768dbc
Request Body schema: application/json
required
Array of objects (NodePoolAssignedResourcesCreate)

Resources assigned to this Department per Node Pool

name
required
string

The name of the department.

deservedGpus
number
Deprecated

Deprecated. Instead, use deserved for the relevant resource type under NodePoolResources. Deserved GPUs for the department.

allowOverQuota
boolean
Deprecated

Deprecated. Instead, use maxAllowed for the relevant resource type under NodePoolResources. Is over quota allowed for the department.

maxAllowedGpus
number
Deprecated

Deprecated. Instead, use maxAllowed for the relevant resource type under NodePoolResources. Max allowed GPUs for the department.

object
Deprecated

Deprecated. Instead, use 'nodePoolsResources'. Total resources assigned to the Department. Can only be used in PUT/POST when there is a single Node Pool in the system. The resources returned in GET are the sum of all Node Pool Resources.

Responses
200

Department created successfully.

post/v1/k8s/clusters/{clusterId}/departments
Request samples
application/json
{
  • "nodePoolsResources": [
    ],
  • "name": "default",
  • "deservedGpus": 2,
  • "allowOverQuota": false,
  • "maxAllowedGpus": 2,
  • "resources": {
    }
}
Response samples
application/json
{
  • "name": "default",
  • "deservedGpus": 2,
  • "allowOverQuota": false,
  • "maxAllowedGpus": 2,
  • "resources": {
    }
}

Set the department admins.Deprecated

Deprecated. Instead, use the accessrules API to add the department-admin permissions to a specific subject.

SecuritybearerAuth
Request
path Parameters
clusterId
required
string

The unique uuid identifying the cluster.

Example: 9f55255e-11ed-47c7-acef-fc4054768dbc
department-id
required
integer

The unique id identifying the department.

Example: 2
Request Body schema: application/json
required
departmentId
integer <int32>

The unique id identifying the department.

departmentAdmins
Array of strings

Id's of users with department admin role that are assigned to managed the department

Responses
201

Department admin set successfully.

400

Bad request.

401

Unauthenticated

403

Forbidden

put/v1/k8s/clusters/{clusterId}/departments/{department-id}/access-control
Request samples
application/json
{
  • "departmentId": 2,
  • "departmentAdmins": [
    ]
}
Response samples
application/json
{
  • "departmentId": 2,
  • "departmentAdmins": [
    ]
}