What's on this page

Descriptors

The following details the API to manage descriptors within TNC-O. Assembly descriptors can be added, listed, updated and deleted. Resource descriptors can be listed and deleted but can only be added or updated through the Resource Manager API.

Associated with each definition are details of the request parameters and responses. These include the name of each field plus a brief description and whether the field is mandatory. Whether a field is required or not is based on the context of the examples. The underlying API definition may mark a field as optional, but in some contexts, the fields must be supplied.

For a 40x, 50x or any other error response please see error response codes

Create Assembly Descriptor

Creates a new Assembly descriptor

Request

AspectValue
Endpoint URL/api/catalog/descriptors
Content-Type:application/yaml
HTTP MethodPOST

Body

The body content should be an Assembly descriptor in YAML format. See Assembly Descriptor YAML specification

Response

AspectValue
Response Code201 (Created)

Headers

FieldDescription
locationEndpoint to descriptor resource

Body

FieldDescription
descriptorNameThe name of the descriptor
validationWarningsWarnings returned from the validation of the descriptor (if any)

Example:

{
  "descriptorName": "assembly::example::1.0",
  "validationWarnings": []
}

Remove Assembly Descriptor

Removes an Assembly descriptor from TNC-O.

Request

AspectValue
Endpoint URL/api/catalog/descriptors/{descriptorName}
HTTP MethodDELETE

Path Parameters

FieldDescriptionMandatory
descriptorNamename of the descriptor to removeYes

The descriptor name is the full name of the descriptor, e.g. assembly::t_single::1.0. This will need to be encoded appropriately for use as a url – i.e. assembly%3A%3At_single%3A%3A1.0

Response

AspectValue
Response Code204 (No content)

Update Assembly Descriptor

Updates an existing Assembly descriptor in TNC-O.

Request

AspectValue
Endpoint URL/api/catalog/descriptors/{descriptorName}
Content-Type:application/yaml
HTTP MethodPUT

Path Parameters

FieldDescriptionMandatory
descriptorNamename of the descriptor to retrieveYes

The descriptor name is the full name of the descriptor, e.g. assembly::t_single::1.0. This will need to be encoded appropriately for use as a url – i.e. assembly%3A%3At_single%3A%3A1.0

Body

The body content should be an Assembly descriptor in YAML format. See Assembly Descriptor YAML specification

Response

AspectValue
Response Code200 (OK)

Body

FieldDescription
descriptorNameThe name of the descriptor
validationWarningsWarnings returned from the validation of the descriptor (if any)

Example:

{
  "descriptorName": "assembly::example::1.0",
  "validationWarnings": []
}

Get a summary of all Descriptors

This request returns a summary of the descriptors known to TNC-O.

Request

AspectValue
Endpoint URL/api/catalog/descriptors
HTTP MethodGET

Response

AspectValue
Response Code200 (OK)

Body

The body includes a single list of summaries, each with the following fields:

FieldDescription
nameThe name of the descriptor
descriptionDescription of the descriptor
linksReferences to the descriptor resource endpoint

Example:

[

  {
​    "name": "resource::t_simple::1.0",
​    "description": "resource for t_simple",
​    "links": [
​      {
​        "rel": "self",
​        "href": "http://192.168.99.100:8280/api/ /catalog/descriptors/resource::t_simple::1.0"
​      }
​    ]
  },
  {
​    "name": "resource::h_simple::1.0",
​    "description": "resource for  t_simple",
​    "links": [
​      {
​        "rel": "self",
​        "href": "http://192.168.99.100:8280 /api/catalog/descriptors/resource::h_simple::1.0"
​      }
​    ]
  }
]

Get Descriptor by Name

Returns an existing descriptor from TNC-O.

Request

AspectValue
Endpoint URL/api/catalog/descriptors/{descriptorName}
HTTP MethodGet

Path Parameters

FieldDescriptionMandatory
descriptorNamename of the descriptor to retrieveYes

The descriptor name is the full name of the descriptor, e.g. assembly::t_single::1.0. This will need to be encoded appropriately for use as a url – i.e. assembly%3A%3At_single%3A%3A1.0

Response

AspectValue
Content-Typeapplication/yaml
Response Code200 (OK)

Body

The body content will be a descriptor in YAML format. See Assembly Descriptor YAML specification