Skip to content

Tag Management Guide

ByoungSeob Kim edited this page Mar 19, 2026 · 1 revision

Tag Management Guide

Language: English | 한국어

1. CB-Spider Tag Management Overview

  • CB-Spider provides Tag functionality for managed cloud resources across connected CSPs.
  • Users can use Tags to group and identify resources, enabling automation of large-scale resource management, cost management, and more.
  • A Tag consists of a string Key and a string Value pair. The Key is required, but the Value is optional and can be omitted.
  • Users can add Tags to resources in two ways:
    1. Setting Tags at resource creation: Include a TagList in the resource creation request to add multiple Tags at once
    2. Using the Tag Management API on existing resources: Add, retrieve, and delete Tags via the Tag Management REST API
  • The Tag Management API provides 4 APIs: AddTag, ListTag, GetTag, RemoveTag.
  • Supported resource types: VPC, SUBNET, SG, KEY(keypair), VM, NLB, DISK, MYIMAGE, CLUSTER
┌──────────────────────────────────────────────────────────────────┐
│                     CB-Spider Tag Management                     │
│                                                                  │
│  ConnectionName (CSP + Region)                                   │
│        │                                                         │
│        ├── AddTag(ResourceType, ResourceName, Tag)               │
│        │      └── Add Tag(Key, Value)                            │
│        │                                                         │
│        ├── ListTag(ResourceType, ResourceName)                   │
│        │      └── List all Tags of the resource                  │
│        │                                                         │
│        ├── GetTag(ResourceType, ResourceName, Key)               │
│        │      └── Get a specific Tag (by Key)                    │
│        │                                                         │
│        └── RemoveTag(ResourceType, ResourceName, Key)            │
│               └── Remove a specific Tag (by Key)                 │
│                                                                  │
│  Supported Resource Types                                        │
│    VPC, SUBNET, SG, KEY(keypair), VM, NLB,                       │
│    DISK, MYIMAGE, CLUSTER                                        │
└──────────────────────────────────────────────────────────────────┘

2. Tag Support Status by CSP

  • The Tag support status per CSP and resource type is as follows:

    Provider VPC Subnet SecurityGroup VM KeyPair VM Disk MyImage NLB Cluster
    AWS O O O O O O O O O
    Azure O - O O O O O O O
    GCP - - - - O O - - O
    Alibaba O O O O O O -
    Tencent O O O O O O O O O
    IBM O O O O O O O O O
    OpenStack O O O - O - - O -
    KT Classic - - - - O O O - -
    ※ △: Tagging is only supported at resource creation time
    ※  - : The CSP does not provide Tagging for this resource
    ※ NHN, NCP, KT VPC: Tagging is not supported
       - Tag API calls return the following error message: "nhn-config does not support TagHandler"
    
    ※ Handling Tag API calls for unsupported resources:
      (1) Tag setting at resource creation: The resource is created, but Tags are not added (no log output)
      (2) Adding Tags to an existing resource: Returns a common error message (Error Log output)
         • format: "[TAG_NOT_SUPPORTED] Tagging is not supported for the resource: {CSP}-{RESOURCE}"
         • example: "[TAG_NOT_SUPPORTED] Tagging is not supported for the resource: GCP-keypair"
    

3. Prerequisites

  • The target CSP Connection must be properly registered.
  • The target resource (VPC, VM, etc.) to add/retrieve Tags for must already be created.

4. CB-Spider Tag API and Data Specification

  • Users can retrieve Tag information in JSON format using the following CB-Spider REST API.

4.1 Tag API

# Add a Tag
POST /spider/tag                  - Add Tag

# List all Tags
GET  /spider/tag                  - List Tags

# Get a specific Tag
GET  /spider/tag/{Key}            - Get Tag

# Remove a Tag
DELETE /spider/tag/{Key}          - Remove Tag

4.2 Request Parameters

AddTag (POST /spider/tag)

Parameter Description Example
ConnectionName Target Connection name aws-seoul-config
ReqInfo.ResourceType Resource type VPC, VM, SG, etc.
ReqInfo.ResourceName Resource name vpc-01, my-vm
ReqInfo.Tag Tag to add (Key, Value pair) {"Key": "env", "Value": "prod"}

ListTag (GET /spider/tag)

Parameter Description Example
ConnectionName Target Connection name aws-seoul-config
ResourceType Resource type VPC, VM, etc.
ResourceName Resource name vpc-01

GetTag (GET /spider/tag/{Key})

Parameter Description Example
ConnectionName Target Connection name aws-seoul-config
ResourceType Resource type VPC, VM, etc.
ResourceName Resource name vpc-01
Key Key of the Tag to retrieve env

RemoveTag (DELETE /spider/tag/{Key})

Parameter Description Example
ConnectionName Target Connection name aws-seoul-config
ReqInfo.ResourceType Resource type VPC, VM, etc.
ReqInfo.ResourceName Resource name vpc-01
Key Key of the Tag to remove env

4.3 Resource Types (ResourceType)

Resource Type Value Description
VPC VPC Virtual Private Cloud
Subnet SUBNET Subnet
Security Group SG Security Group
KeyPair KEY VM SSH KeyPair
VM VM Virtual Machine
NLB NLB Network Load Balancer
Disk DISK Disk (Volume)
MyImage MYIMAGE VM Snapshot Image
Cluster CLUSTER Kubernetes Cluster

4.4 Data Specification

Tag Information (KeyValue)

Field Description Example
Key Tag key env, team, project
Value Tag value production, backend, spider

ListTag Response Format

Field Description
tag List of Tags (KeyValue array)
resourceType Human-readable name of the resource type

5. CB-Spider Tag API Examples

5.1 Add a Tag (AddTag)

curl -u "$SPIDER_USERNAME:$SPIDER_PASSWORD" -sX POST 'http://localhost:1024/spider/tag' \
  -H 'Content-Type: application/json' \
  -d '{
    "ConnectionName": "aws-seoul-config",
    "ReqInfo": {
      "ResourceType": "VPC",
      "ResourceName": "vpc-01",
      "Tag": {
        "Key": "env",
        "Value": "production"
      }
    }
  }' | jq

Response Example:

{
  "Key": "env",
  "Value": "production"
}

5.2 List Tags (ListTag)

curl -u "$SPIDER_USERNAME:$SPIDER_PASSWORD" -sX GET \
  'http://localhost:1024/spider/tag?ConnectionName=aws-seoul-config&ResourceType=VPC&ResourceName=vpc-01' | jq

Response Example:

{
  "tag": [
    {
      "Key": "env",
      "Value": "production"
    },
    {
      "Key": "team",
      "Value": "backend"
    },
    {
      "Key": "Name",
      "Value": "vpc-01"
    }
  ],
  "resourceType": "VPC"
}

5.3 Get a Specific Tag (GetTag)

curl -u "$SPIDER_USERNAME:$SPIDER_PASSWORD" -sX GET \
  'http://localhost:1024/spider/tag/env?ConnectionName=aws-seoul-config&ResourceType=VPC&ResourceName=vpc-01' | jq

Response Example:

{
  "Key": "env",
  "Value": "production"
}

5.4 Remove a Tag (RemoveTag)

curl -u "$SPIDER_USERNAME:$SPIDER_PASSWORD" -sX DELETE 'http://localhost:1024/spider/tag/env' \
  -H 'Content-Type: application/json' \
  -d '{
    "ConnectionName": "aws-seoul-config",
    "ReqInfo": {
      "ResourceType": "VPC",
      "ResourceName": "vpc-01"
    }
  }' | jq

Response Example:

{
  "Result": "true"
}

5.5 Setting Tags at Resource Creation (e.g., VPC Creation)

Tags can be added at creation time by including a TagList in the request body of a resource creation API.

curl -u "$SPIDER_USERNAME:$SPIDER_PASSWORD" -sX POST 'http://localhost:1024/spider/vpc' \
  -H 'Content-Type: application/json' \
  -d '{
    "ConnectionName": "aws-seoul-config",
    "ReqInfo": {
      "Name": "vpc-01",
      "IPv4_CIDR": "10.0.0.0/16",
      "SubnetInfoList": [
        {
          "Name": "subnet-01",
          "IPv4_CIDR": "10.0.1.0/24"
        }
      ],
      "TagList": [
        {"Key": "env", "Value": "production"},
        {"Key": "team", "Value": "backend"}
      ]
    }
  }' | jq

6. Notes and Limitations

6.1 Tag Support Scope Varies by CSP

  • The resource types that support Tags differ by CSP (refer to Section 2: Tag Support Status by CSP).
  • Some CSPs (e.g., Alibaba) only allow Tag settings at resource creation time for certain resources, and Tags cannot be added via the Tag Management API afterward (marked with △).

6.2 Handling Unsupported CSPs and Resources

  • NHN, NCP, KT VPC do not support Tagging. Tag API calls return the following error message:
    • "<csp>-config does not support TagHandler"
  • Handling Tag API calls for unsupported resources:
    1. Tag setting at resource creation: The resource is created normally, but Tags are not added (no log output)
    2. Adding Tags to an existing resource: Returns a common error message (Error log output)
      • format: [TAG_NOT_SUPPORTED] Tagging is not supported for the resource: {CSP}-{RESOURCE}
      • example: [TAG_NOT_SUPPORTED] Tagging is not supported for the resource: GCP-keypair

6.3 Duplicate Keys Not Allowed

  • Duplicate Keys with the same name cannot be added to the same resource.
  • Calling AddTag with an already existing Key returns an error.

6.4 Error Handling for Tags During Resource Creation

  • If some Tags in the TagList fail during resource creation:
    1. The created resource is preserved.
    2. Successfully created Tags are set in the TagList of the returned information.
    3. Failed Tags return an error message in the following format:
      • "TaggingError: {Key01, Value01}, {Key05, Value05}: CSP error message"

6.5 GetTag and RemoveTag Key Uses Strict Match

  • The Key value in GetTag and RemoveTag APIs must match exactly (partial matching is not supported).

7. API Response Codes

HTTP Status Description
200 OK Request successful
400 Bad Request Invalid request (missing required parameters, invalid resource type, etc.)
404 Not Found Target resource not found
500 Internal Server Error Server internal error or CSP API error

8. References

Table of contents




Clone this wiki locally