Resource Labels
    • PDF

    Resource Labels

    • PDF

    Article summary

    1. Create a Resource Label

    This POST method is used to create a resource label.

    POST{{url}}/api/resource-manager/labels

    Request Example

    curl --location --request POST '{{url}}/api/resource-manager/labels' \
    --header 'Authorization: TOKEN {{apiToken}}'
    --data-raw '
    {
      "keyId": "string",
      "keyName": "string",
      "internal": true,
      "description": "string",
      "values": [
        {
          "valueId": "string",
          "keyId": "string",
          "name": "string",
          "description": "string",
          "createdBy": 0,
          "updatedBy": 0,
          "resourceCount": 0,
          "createdOn": "string",
          "updatedOn": "string"
        }
      ]
    }'

    Response Example 

    Status: 201 Created
    {
      "keyId": "string",
      "keyName": "string",
      "internal": true,
      "description": "string",
      "values": [
        {
          "valueId": "string",
          "keyId": "string",
          "name": "string",
          "description": "string",
          "createdBy": 0,
          "updatedBy": 0,
          "resourceCount": 0,
          "createdOn": "string",
          "updatedOn": "string"
        }
      ]
    }

    2. Retrieve Resource Labels

    This GET method is used to retrieve a list of all resource labels

    GET{{url}}/api/resource-manager/labels

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    searchTextFilter resource labels by searching text.StringOptional
    pageSpecifies the page number of the resource labels records to retrieve,IntegerOptional
    sizeSpecifies the number of resource label records to retrieve per page,IntegerOptional
    sortSpecifies the sorting and direction.StringOptional

    Request Example

    curl --location --request GET '{{url}}/api/resource-manager/labels' \
    --header 'Authorization: TOKEN {{apiToken}}'

    Response Example 

    Status: 200 OK
    {
      "count": 0,
      "page": 0,
      "size": 0,
      "sort": "string",
      "data": [
        {
          "keyId": "string",
          "keyName": "string",
          "internal": true,
          "description": "string",
          "values": [
            {
              "valueId": "string",
              "keyId": "string",
              "name": "string",
              "description": "string",
              "createdBy": 0,
              "updatedBy": 0,
              "resourceCount": 0,
              "createdOn": "string",
              "updatedOn": "string"
            }
          ]
        }
      ]
    }

    3. Manage Resource Label

    This PUT method is used to manage a resource label.

    PUT{{url}}/api/resource-manager/labels/{keyId}

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    keyIdResource label key ID.StringMandatory

    Request Example

    curl --location --request PUT '{{url}}/api/resource-manager/labels/{keyId}' \
    --header 'Authorization: TOKEN {{apiToken}}'
    --data-raw '
    {
      "keyId": "string",
      "keyName": "string",
      "internal": true,
      "description": "string",
      "values": [
        {
          "valueId": "string",
          "keyId": "string",
          "name": "string",
          "description": "string",
          "createdBy": 0,
          "updatedBy": 0,
          "resourceCount": 0,
          "createdOn": "string",
          "updatedOn": "string"
        }
      ]
    }'

    Response Example 

    Status: 200 OK
    {
      "keyId": "string",
      "keyName": "string",
      "internal": true,
      "description": "string",
      "values": [
        {
          "valueId": "string",
          "keyId": "string",
          "name": "string",
          "description": "string",
          "createdBy": 0,
          "updatedBy": 0,
          "resourceCount": 0,
          "createdOn": "string",
          "updatedOn": "string"
        }
      ]
    }

    4. Retrieve Resource Label Key Details

    This GET method is used to retrieve all details of a resource label key.

    GET{{url}}/api/resource-manager/labels/{keyId}

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    keyIdResource Label Key IDStringMandatory

    Request Example

    curl --location --request GET '{{url}}/api/resource-manager/labels/{keyId} \
    --header 'Authorization: TOKEN {{apiToken}}'

    Response Example 

    Status: 201 Created
    {
      "keyId": "string",
      "keyName": "string",
      "internal": true,
      "description": "string",
      "values": [
        {
          "valueId": "string",
          "keyId": "string",
          "name": "string",
          "description": "string",
          "createdBy": 0,
          "updatedBy": 0,
          "resourceCount": 0,
          "createdOn": "string",
          "updatedOn": "string"
        }
      ]
    }

    5. Delete a Resource Label

    This DELETE method deletes a resource label.

    DELETE{{url}}/api/resource-manager/labels/{keyId}

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    keyIdResource Label key ID.StringMandatory

    Request Example

    curl --location --request DELETE '{{url}}/api/resource-manager/labels/{keyId}' \ --header 'Authorization: TOKEN {{apiToken}}'
    

    Response Example 

    Status: 204 No Content

    Was this article helpful?