Labels

This section describes a set of API requests that allow managing labels, allowing users to do different operations over labels into the system.

Labels allow organizing different resources on the platform from 7.3 onwards. The following resources can have labels assigned:

  • Cookbook Versions
  • Templates
  • Servers
  • Server Arrays
  • Scripts
  • SSH Profiles
  • Firewall Profiles
  • Floating IPs
  • Load Balancers
  • VPCs
  • Volumes
  • CATs

Contents

Labels

List labels

GET /v3/labels

It lists all labels currently available at the platform.

Inputs

None

Returns

An array of labels with the following fields:

Field Type Description
id String Identifier of the label.
name String The logical name for the label.
namespace String The namespace that usually identifies a technical use for the label.
value String A value for the grouping of resources usually with a technical semantic.
resource_type String An identifier for the type of resource, specifically "label".

Back to top

Show Label

GET /v3/labels/:id

It shows information about a specific label.

Inputs

None

Returns

Field Type Description
id String Identifier of the label.
name String The logical name for the label.
namespace String The namespace that usually identifies a technical use for the label.
value String A value for the grouping of resources usually with a technical semantic.
resource_type String An identifier for the type of resource, specifically "label".

Back to top

Create Label

POST /v3/labels

It creates a new label.

Inputs

Field Type Description Required
name String Name of the script. Yes
namespace String The namespace that usually identifies a technical use for the label. No
value String A value for the grouping of resources usually with a technical semantic. No

Returns

Field Type Description
id String Identifier of the label.
name String The logical name for the label.
namespace String The namespace that usually identifies a technical use for the label.
value String A value for the grouping of resources usually with a technical semantic.
resource_type String An identifier for the type of resource, specifically "label".

Back to top

Update Label

PUT /v3/labels/:id

It updates an existing label.

Inputs

Field Type Description Required
value String A value for the grouping of resources usually with a technical semantic. No

Returns

Field Type Description
id String Identifier of the label.
name String The logical name for the label.
namespace String The namespace that usually identifies a technical use for the label.
value String A value for the grouping of resources usually with a technical semantic.
resource_type String An identifier for the type of resource, specifically "label".

Back to top

Destroy Label

DELETE /v3/labels/:id

It destroys a label.

Inputs

None

Returns

None

Back to top

List resources of a label

GET /v3/labels/:label_id/resources

Lists the resources that have the label assigned

Inputs

None

Returns

An array of resources, each with the following fields:

Field Type Description
id String Identifier of the resource.
resource_type String An identifier for the type of resource.

Back to top

Add resource to a label

POST /v3/labels/:label_id/resources

It adds resources to an existing label.

Inputs

An array of resources under a resources key, each with the following fields:

Field Type Description Required
id String Identifier of the resource. Yes
resource_type String An identifier for the type of resource. Yes

Returns

An array with all of the resources of the label, each with the following fields:

Field Type Description
id String Identifier of the resource.
resource_type String An identifier for the type of resource.

Back to top

Destroy resource from a label

DELETE /v3/labels/:label_id/resources/:resource_type/:id

It removes the resource of the given resource type and id from the label with the given label id.

Inputs

None

Returns

None

Back to top