spctl specs - cloud-barista/cb-spider GitHub Wiki

spctl Specification


Usage:

$ spctl [global flag] resource [resource flag] command [command flag]

Global Flags:

Flag Description
-v, --version Print the version information
-s, --server string Spider server URL (default "localhost:1024")
-u, --username string API username (default: $SPIDER_USERNAME)
-p, --password string API password (default: $SPIDER_PASSWORD)
-h, --help Help for spctl

Authentication: Both username and password are required for API access.
Credentials can be provided via flags (-u, -p) or environment variables (SPIDER_USERNAME, SPIDER_PASSWORD).
Flags take precedence over environment variables.


Resource Flags:

Flag Description
-h, --help Help for resource

Command Flags:

Create:

Flag Description
-h, --help Help for command
-d, --data string Input string data in JSON format

List:

Flag Description
-c, --ConnectionName string Connection name
-h, --help Help for command

Get:

Flag Description
-c, --ConnectionName string Connection name
-n, --Name string Resource name
-h, --help Help for command

Delete:

Flag Description
-n, --Name string Resource name
--force string Force flag (true/false) (default "false")
-h, --help Help for command

Resources and Commands:

Resource Command Description
all-cluster count Get the total number of Clusters across all connections.
list Retrieve a comprehensive list of all Clusters associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-cluster-info list Retrieve a comprehensive list of all Cluster information associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
all-connection count Get the total number of connections.
all-disk count Get the total number of Disks across all connections.
list Retrieve a comprehensive list of all Disks associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-disk-info list Retrieve a comprehensive list of all Disk information associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
all-keypair count Get the total number of KeyPairs across all connections.
list Retrieve a comprehensive list of all KeyPairs associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-keypair-info list Retrieve a comprehensive list of all KeyPair information associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
all-myimage count Get the total number of MyImages across all connections.
list Retrieve a comprehensive list of all MyImages associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-myimage-info list Retrieve a comprehensive list of all MyImage information associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
all-nics count Get the total number of NICs registered across all connections.
all-nlb count Get the total number of Network Load Balancers (NLBs) across all connections.
list Retrieve a comprehensive list of all Network Load Balancers (NLBs) associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-nlb-info list Retrieve a comprehensive list of all NLB information associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
all-publicips count Get the total number of Public IPs registered across all connections.
all-rdbms count Get the total number of RDBMS instances across all connections.
list Retrieve a comprehensive list of all RDBMS instances associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-rdbms-info list Retrieve a comprehensive list of all RDBMS information associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
all-resource destroy Deletes all resources associated with a specific cloud connection. This action is irreversible.
all-s3-bucket count Get the total number of S3 Buckets registered across all connections.
list Retrieve a comprehensive list of all S3 Buckets associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-s3-bucket-info list Retrieve detailed info of all S3 Buckets associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
all-securitygroup count Get the total number of Security Groups across all connections.
list Retrieve a comprehensive list of all Security Groups associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-securitygroup-info list Retrieve a comprehensive list of all Security Group information associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
all-subnet count Get the total number of Subnets across all connections.
all-vm count Get the total number of Virtual Machines (VMs) across all connections.
list Retrieve a comprehensive list of all Virtual Machines (VMs) associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-vm-info list Retrieve detailed information on all Virtual Machines associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
all-vpc count Get the total number of VPCs across all connections.
list Retrieve a comprehensive list of all Virtual Private Clouds (VPCs) associated with a specific connection, including those mapped between CB-Spider and the CSP, only registered in CB-Spider's metadata, and only existing in the CSP.
all-vpc-info list Retrieve a comprehensive list of all VPC information associated with a specific connection, categorized into MappedInfoList, OnlySpiderList, and OnlyCSPInfoList.
call any Execute a custom function (FID) with key-value parameters through AnyCall.
check-health health Checks the health of CB-Spider service and its dependencies via /health endpoint.
check-healthcheck health Checks the health of CB-Spider service and its dependencies via /healthcheck endpoint.
check-ping health Checks the health of CB-Spider service and its dependencies via /ping endpoint.
check-readyz health Checks the health of CB-Spider service and its dependencies via /readyz endpoint.
cloudos list Retrieve a list of supported Cloud OS.
cloudos-metainfo get Retrieve metadata information for a specific Cloud OS.
cluster create Create a new Cluster with specified configurations.
delete Delete a specified Cluster.
get Retrieve details of a specific Cluster.
list Retrieve a list of Clusters associated with a specific connection.
register Register a new Cluster with the specified VPC and CSP ID.
unregister Unregister a Cluster with the specified name.
upgrade Upgrade a Cluster to a specified version.
cluster-by-connection count Get the total number of Clusters for a specific connection.
cluster-owner-vpc get Retrieve the owner VPC of a specified Cluster.
cluster-token get Get a temporary token for accessing EKS cluster (for kubectl exec auth).
completion bash Generate the autocompletion script for bash.
connection create Create a new Connection Config.
delete Delete a specific Connection Config.
get Retrieve details of a specific Connection Config.
list Retrieve a list of registered Connection Configs.
connection-by-provider count Get the total number of connections for a specific provider.
credential get Retrieve details of a specific Credential.
list Retrieve a list of registered Credentials.
register Register a new Credential.
unregister Unregister a specific Credential.
csp-cluster delete Delete a specified CSP Cluster.
csp-disk delete Delete a specified CSP Disk.
csp-keypair delete Delete a specified CSP KeyPair.
csp-myimage delete Delete a specified CSP MyImage.
csp-nlb delete Delete a specified CSP Network Load Balancer (NLB).
csp-rdbms delete Delete a specified CSP RDBMS.
csp-s3-bucket delete Delete a specified CSP S3 Bucket directly from the CSP without affecting CB-Spider metadata.
csp-securitygroup delete Delete a specified CSP Security Group.
csp-subnet remove Remove an existing CSP Subnet from a VPC.
csp-vm get Retrieve details of a specific CSP Virtual Machine (VM).
terminate Terminate a specified CSP Virtual Machine (VM).
csp-vpc delete Delete a specified CSP Virtual Private Cloud (VPC).
disk attach Attach an existing Disk to a VM.
create Create a new Disk with the specified configuration.
delete Delete a specified Disk.
detach Detach an existing Disk from a VM.
get Retrieve details of a specific Disk.
list Retrieve a list of Disks associated with a specific connection.
register Register a new Disk with the specified name, zone, and CSP ID.
unregister Unregister a Disk with the specified name.
disk-by-connection count Get the total number of Disks for a specific connection.
disk-size increase Increase the size of an existing disk.
driver get Retrieve details of a specific Cloud Driver.
list Retrieve a list of registered Cloud Drivers.
register Register a new Cloud Driver.
unregister Unregister a specific Cloud Driver.
upload Upload a Cloud Driver library file.
driver-capability get Retrieve capability information of the cloud driver.
filesystem create Create a new FileSystem with the specified configuration.
image get Retrieve details of a specific Public Image.
list Retrieve a list of Public Images associated with a specific connection.
info version Retrieve the version information of CB-Spider.
keypair create Create a new KeyPair with the specified configurations.
delete Delete a specified KeyPair.
get Retrieve details of a specific KeyPair.
list Retrieve a list of KeyPairs associated with a specific connection.
register Register a new KeyPair with the specified name and CSP ID.
unregister Unregister a KeyPair with the specified name.
keypair-by-connection count Get the total number of KeyPairs for a specific connection.
myimage create Create a new MyImage snapshot from a specified VM.
delete Delete a specified MyImage.
get Retrieve details of a specific MyImage.
list Retrieve a list of MyImages associated with a specific connection.
register Register a new MyImage with the specified name and CSP ID.
unregister Unregister a MyImage with the specified name.
myimage-by-connection count Get the total number of MyImages for a specific connection.
nic attach Attach a NIC to a VM instance.
create Create a new Network Interface Card (NIC).
delete Delete a NIC.
detach Detach a NIC from its VM instance.
get Retrieve details of a specific NIC.
list Retrieve a list of Network Interface Cards.
register Register an existing NIC with the specified name and CSP ID.
unregister Unregister a NIC with the specified name.
nic-by-connection count Get the total number of NICs for a specific connection.
nic-osconfigscript get Return a bash script to execute inside the VM OS after a secondary NIC is attached.
nic-privateip add Add a secondary private IP to a NIC. Leave PrivateIP empty for CSP auto-assignment.
remove Remove a secondary private IP from a NIC.
nlb create Create a new Network Load Balancer (NLB) with specified configurations.
delete Delete a specified Network Load Balancer (NLB).
get Retrieve details of a specific Network Load Balancer (NLB).
list Retrieve a list of Network Load Balancers (NLBs) associated with a specific connection.
register Register a new Network Load Balancer (NLB) with the specified name and CSP ID.
unregister Unregister a Network Load Balancer (NLB) with the specified name.
nlb-by-connection count Get the total number of Network Load Balancers (NLBs) for a specific connection.
nlb-owner-vpc get Retrieve the owner VPC of a specified Network Load Balancer (NLB).
nlb-vm add Add a new set of VMs to an existing Network Load Balancer (NLB).
remove Remove a set of VMs from an existing Network Load Balancer (NLB).
nodegroup add Add a new Node Group to an existing Cluster.
remove Remove an existing Node Group from a Cluster.
nodegroup-autoscaling set Enable or disable auto scaling for a Node Group in a Cluster.
nodegroup-scaling change Change the scaling settings for a Node Group in a Cluster.
org-region list Retrieve a list of Original Regions associated with a specific connection.
org-vm-spec get Retrieve details of a specific Original VM Spec.
list Retrieve a list of Original VM Specs associated with a specific connection.
org-zone list Retrieve a list of Original Zones associated with a specific connection.
preconfigured-original-org-region list Retrieve a list of pre-configured Original Regions based on driver and credential names.
vmprice-info get Retrieve price details of a specific Product Family in a specific Region.
product-family list Retrieve a list of Product Families associated with a specific connection and region.
publicip associate Associate a Public IP address with a VM.
create Allocate a new Public IP address.
delete Release (delete) a Public IP address.
disassociate Remove the VM association from a Public IP address.
get Retrieve details of a specific Public IP.
list Retrieve a list of Public IP addresses.
register Register a new Public IP with the specified name and CSP ID.
unregister Unregister a Public IP with the specified name.
publicip-by-connection count Get the total number of Public IPs for a specific connection.
quota-info get Retrieve all quota limits and current usage for a given service type.
quota-service-type list Retrieve the list of service type names for which quota information is available.
rdbms create Create a new Relational Database (RDBMS) with the specified configuration.
delete Delete a specified RDBMS instance.
get Retrieve details of a specific RDBMS instance.
list Retrieve a list of RDBMS instances associated with a specific connection.
register Register a new RDBMS with the specified name and CSP ID.
unregister Unregister an RDBMS with the specified name.
rdbms-by-connection count Get the total number of RDBMS instances for a specific connection.
rdbms-database create Create a database inside an RDBMS instance using the CSP-native API.
delete Drop a database inside an RDBMS instance using the CSP-native API.
rdbms-databases list List databases inside an RDBMS instance using the CSP-native API.
rdbms-metainfo get Retrieve CSP-specific RDBMS capability information (supported engines, features, etc.).
rdbms-owner-vpc get Retrieve the Owner VPC of a given RDBMS CSP ID.
region get Retrieve details of a specific Region.
list Retrieve a list of registered Regions.
register Register a new Region.
unregister Unregister a specific Region.
region-zone get Retrieve details of a specific Region Zone.
list Retrieve a list of Region Zones associated with a specific connection.
region-zone-preconfig get Retrieve details of a specific pre-configured Region Zone based on driver and credential names.
list Retrieve a list of pre-configured Region Zones based on driver and credential names.
rule add Add new rules to a Security Group.
remove Remove existing rules from a Security Group.
s3-bucket create Create a new S3 bucket.
delete Delete an S3 bucket.
register Register an existing CSP S3 bucket into CB-Spider metadata with a user-defined name.
unregister Remove an S3 bucket mapping from CB-Spider metadata without deleting it from the CSP.
s3-bucket-get get List objects in bucket or get bucket configuration (varies by query parameter).
s3-bucket-head get Check if a bucket exists using HEAD request. Returns 200 if exists, 404 if not found.
s3-bucket-usage get Returns the total size (in bytes) of all objects stored in an S3 bucket.
s3-buckets list Returns a list of all buckets owned by the authenticated sender of the request.
s3-by-connection count Get the total number of S3 buckets for a specific connection.
s3-object delete Delete an object or abort a multipart upload based on query parameters.
download Download an object from S3 or list parts of a multipart upload.
s3-object-from-file put Upload a file to S3 bucket or upload a part for multipart upload based on query parameters.
s3-object-from-form put Upload a file using HTML form (multipart/form-data) or delete multiple objects.
s3-object-info get Returns metadata about an object without returning the object itself.
s3-object-post handle Object-level POST operations (response varies by query parameter).
s3-presigned-upload-url get Generate a presigned URL that can be used to upload an object to S3 without requiring credentials.
s3-presigned-url get Generate a presigned URL that can be used to download an object from S3 without requiring credentials.
securitygroup create Create a new Security Group with specified rules and tags.
delete Delete a specified Security Group.
get Retrieve details of a specific Security Group.
list Retrieve a list of Security Groups associated with a specific connection.
register Register a new Security Group with the specified name and CSP ID.
unregister Unregister a Security Group with the specified name.
securitygroup-by-connection count Get the total number of Security Groups for a specific connection.
sg-owner-vpc get Retrieve the owner VPC of a specified Security Group.
subnet add Add a new Subnet to an existing VPC.
get Retrieve a specific Subnet from a VPC.
register Register a new Subnet within a specified VPC.
remove Remove an existing Subnet from a VPC.
unregister Unregister a Subnet from a specified VPC.
subnet-by-connection count Get the total number of Subnets for a specific connection.
tag add Add a tag to a specified resource.
get Retrieve a specific tag for a specified resource.
list Retrieve a list of tags for a specified resource.
remove Remove a specific tag from a specified resource.
tcp-port check Verifies whether a given TCP port is open on the specified host.
topology-layout delete Delete one named topology layout version.
get Get one saved topology layout version.
save Save a topology layout.
topology-layouts list List all saved topology layout versions.
udp-port check Verifies whether a given UDP port is open on the specified host.
vm control Control the state of a Virtual Machine (VM) such as suspend, resume, or reboot.
get Retrieve details of a specific Virtual Machine (VM).
list Retrieve a list of Virtual Machines (VMs) associated with a specific connection.
register Register a new Virtual Machine (VM) with the specified name and CSP ID.
start Start a new Virtual Machine (VM) with specified configurations.
terminate Terminate a specified Virtual Machine (VM).
unregister Unregister a Virtual Machine (VM) with the specified name.
vm-by-connection count Get the total number of Virtual Machines (VMs) for a specific connection.
vm-status get Retrieve the status of a specific Virtual Machine (VM).
list Retrieve a list of statuses for Virtual Machines (VMs) associated with a specific connection.
vm-using-rs get Retrieve details of a VM using resource ID.
vmgroup-healthinfo get Retrieve the health information of the VM group in a specified Network Load Balancer (NLB).
vmspec get Retrieve details of a specific VM spec.
list Retrieve a list of VM specs associated with a specific connection.
vpc create Create a new Virtual Private Cloud (VPC) with specified subnet configurations.
delete Delete a specified Virtual Private Cloud (VPC).
get Retrieve details of a specific Virtual Private Cloud (VPC).
list Retrieve a list of Virtual Private Clouds (VPCs) associated with a specific connection.
register Register a new Virtual Private Cloud (VPC) with the specified name and CSP ID.
unregister Unregister a VPC with the specified name.
vpc-by-connection count Get the total number of VPCs for a specific connection.

Examples:

Help

This command shows all available vpc commands.

$ spctl vpc (help)
Commands for vpc

Usage:
  spctl vpc [command]

Available Commands:
  create      Create a new Virtual Private Cloud (VPC) with specified subnet configurations. 🕷️ [[User Guide](https://github.com/cloud-barista/cb-spider/wiki/features-and-usages#3-vpcsubnet-%EC%83%9D%EC%84%B1-%EB%B0%8F-%EC%A0%9C%EC%96%B4)]
  delete      Delete a specified Virtual Private Cloud (VPC).
  get         Retrieve details of a specific Virtual Private Cloud (VPC).
  list        Retrieve a list of Virtual Private Clouds (VPCs) associated with a specific connection.
  register    Register a new Virtual Private Cloud (VPC) with the specified name and CSP ID.
  unregister  Unregister a VPC with the specified name.

Flags:
  -h, --help   help for vpc

Global Flags:
  -p, --password string   API password (default: $SPIDER_PASSWORD)
  -s, --server string     Spider server URL (default "localhost:1024")
  -u, --username string   API username (default: $SPIDER_USERNAME)

Use "spctl vpc [command] --help" for more information about a command.

Create Command Guidance

The command supports full and required fields examples for creating a VPC.

./spctl vpc create
Usage:
  spctl vpc create [flags]

Flags:
  -d, --data string   JSON Body/Form parameter: VPCCreateRequest
  -h, --help          help for create

Global Flags:
  -p, --password string   API password (default: $SPIDER_PASSWORD)
  -s, --server string     Spider server URL (default "localhost:1024")
  -u, --username string   API username (default: $SPIDER_USERNAME)

Examples:
    Example JSON for VPCCreateRequest with all fields:
    '{
        "ConnectionName": "aws-connection",
        "IDTransformMode": "ON",
        "ReqInfo": {
          "IPv4_CIDR": "10.0.0.0/16",
          "Name": "vpc-01",
          "SubnetInfoList": [
            {
              "IPv4_CIDR": "10.0.8.0/22",
              "Name": "subnet-01",
              "TagList": [
                {
                  "Key": "key1",
                  "Value": "value1"
                }
              ],
              "Zone": "us-east-1b"
            }
          ],
          "TagList": [
            {
              "Key": "key1",
              "Value": "value1"
            }
          ]
        }
      }'

    Example JSON for VPCCreateRequest with required fields only:
    '{
        "ConnectionName": "aws-connection",
        "ReqInfo": {
          "IPv4_CIDR": "10.0.0.0/16",
          "Name": "vpc-01",
          "SubnetInfoList": [
            {
              "IPv4_CIDR": "10.0.8.0/22",
              "Name": "subnet-01"
            }
          ]
        }
      }'

Create VPC Example

$ spctl -u admin -p your-password vpc create -d \
    '{
        "ConnectionName": "aws-connection",
        "ReqInfo": {
          "IPv4_CIDR": "10.0.0.0/16",
          "Name": "vpc-01",
          "SubnetInfoList": [
            {
              "IPv4_CIDR": "10.0.8.0/22",
              "Name": "subnet-01"
            }
          ]
        }
      }'

※ For detailed usage examples and more information, please refer to the spctl User Guide.


This document outlines the command structure, available flags, and the complete set of resources based on the provided Swagger specification from CB-Spider.