Common
Common
Overview
The SCP Command Line Interface (CLI) is an integrated tool for managing SCP’s resources.
You can use various platform services using CLI provided by SCP.
To see detailed commands and examples, please use the help command.
Installation
Download the CLI from the link.
windows
linux
Grant executable rights to the downloaded file.
chmod +x scp-cli
Prerequisites
Issuing Access Keys
To use the CLI functionality of the Samsung cloud platform, you must obtain an authentication key.
The issuance of authentication keys can be found in the upper left corner of the Samsung Cloud Platform Console at My Menu > My Info > Authentication Key > Create App Authentication Key.
Authentication keys consist of a pair of Access Key and Access Secret Key. Authentication keys are used to issue API authentication tokens.
- Log in to the Samsung Cloud Platform website.
- When accessing the My Menu > My Info > Access Key Management menu, click the Create Access Key button.
- After creating the period and usage, click OK to generate an authentication key.
- Check the issued Access Key and Access Secret Key from the access key list.
- Access Secret Key can be found on the Authentication Key Details page.
Security Token Service (Optional)
Security Token Service allow users to access the system with authentication information that is only valid for a specific period. These credentials are typically used for the following purposes:
- Enhanced Security: To minimize damage in case of a leak of long-term credentials (e.g., API keys, passwords).
- Delegated Authority: To temporarily grant limited permissions to external users or systems.
- Automatic Expiration: Credentials expire automatically after a set time, simplifying management
Components
Security Token Service includes the following information:
- Access Key: An identifier for authentication.
- Secret Key: Used to create an encrypted authentication signature.
- Session Token: A token for session identification and validation.
Creating Security Token Service
To use the Samsung Cloud Platform’s temporary security credentials feature, you must create a role.
Role creation can be managed in the Samsung Cloud Platform Console under [My Menu] > [My Info] > [Role]
Principal
- When creating a role, you must define the principal that can assume the role.
- The principal can be an account, user SRN, identity provider, etc., which is authorized to assume the role.
Policy
- You must set a permissions policy that defines what actions the role can perform.
- The policy should adhere to the Principle of Least Privilege, granting only the necessary permissions.
- Log in to the Samsung Cloud Platform Console.
- Navigate to My Menu > My Info > Role and click the Create Role button.
- Enter a role name and select the maximum session duration to set the validity period for assuming the role.
- Under Attach principal, click the Classification button to set the trust entity. You can click the Add button to set multiple trust entities.
- Under Attach Policy, find the desired policy from the policy list and click the checkbox on the left to select it.
- Click the Complete button to finish creating the role.
After this, you must generate a token for the role. This is done by executing the assume-role API, which returns an Access Key, Secret Key, and Session Token.
assume-role Usage Guide : assume-role usage
Execution Environment Setting Management
Configure the CLI’s running environment by defining it as a config file. The file must be created in the form of a file within the PC and in its location.
windows
C:\Users\{user name}\.scp\cli-config.json
linux
~/.scp/cli-config.json
The format of the configuration file supports JSON formats, setting them as follows.
{
"auth_url": "https://iam.s.samsungsdscloud.com/v1/endpoints",
"access_key": "my-access-key",
"access_secret_key": "my-access-secret-key",
"default_scp_region": "kr-west1",
(Optional) "session_token": "session_token"
}
Check Setting Keys
| key | Description | Example |
|---|---|---|
| auth_url | auth url | https://iam.s.samsungsdscloud.com/v1/endpoints |
| access_key | access key | my-access-key |
| access_secret_key | access secret key | my-access-secret-key |
| default_scp_region | default region name | kr-west1 |
| (Optional) session_token | session token from security token service | session_token |
auth_url example
| Environment | env value | Example Service URL |
|---|---|---|
| for Samsung | s | https://iam.s.samsungsdscloud.com/v1/endpoints |
| for Sovereign | g | https://iam.g.samsungsdscloud.com/v1/endpoints |
| for Enterprise | e | https://iam.e.samsungsdscloud.com/v1/endpoints |
CLI Command
Command Help
CLI commands are in the following format.
scp-cli [service] [resource] [actcion] [--option and parameters]
// e.g. ( The input/output results in the example are for illustration purposes and may differ from the actual ones. )
> scp-cli iam user create --user-name TestUser
The available commands are available through –help.
scp-cli iam policy create --help
usage: scp-cli iam policy create [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN] [--noindent] [--prefix PREFIX] [--max-width <integer>] [--fit-width]
[--print-empty] --Version [VERSION] --Statement [STATEMENT ...] --policy_name [POLICY_NAME]
[--default_version_id [DEFAULT_VERSION_ID]] [--description [DESCRIPTION]] [--policy_category [POLICY_CATEGORY]]
[--policy_type [POLICY_TYPE]] [--service_type [SERVICE_TYPE]] [--tags [TAGS ...]] [--policy_id [POLICY_ID]]
[--policy_version_id [POLICY_VERSION_ID]] [--policy_version_name [POLICY_VERSION_NAME]]
Create a policy
options:
-h, --help show this help message and exit
--Version [VERSION]
[Required] Policy Version.
--Statement [STATEMENT ...]
[Required] Statement.
--policy_name [POLICY_NAME]
[Required] Policy Name.
--default_version_id [DEFAULT_VERSION_ID]
[Optional] Default Version Id.
--description [DESCRIPTION]
[Optional] Description.
--policy_category [POLICY_CATEGORY]
[Optional] Policy Category.
--policy_type [POLICY_TYPE]
[Optional] Policy Type.
--service_type [SERVICE_TYPE]
[Optional] Service Type.
--tags [TAGS ...]
[Optional] Policy Tag.
--policy_id [POLICY_ID]
[Optional] Policy ID.
--policy_version_id [POLICY_VERSION_ID]
[Optional] Policy Version Id.
--policy_version_name [POLICY_VERSION_NAME]
[Optional] Policy Version Name.
The “[Required]” mark in the option description is a mandatory option, and the “[Optional]” mark is a selection option.
API Versioning
The CLI supports micro-version style API versions, and you can check the API version for each service using commands.
By default, the latest version supported by the service will be used. Depending on the CLI version, the default API version may differ, which can lead to different output responses.
You can use a fixed version of the CLI by specifying the –
Example CLI Command to Show API Versions
scp-cli versions show [--region-name <region_name>] [--service <service>] [--status <status>] [--timeout <timeout>]
Example API Version CLI Output
+-------------+----------------------------+---------+-----------+---------------------------------------------------------+------------+
| Region Name | Service Name | Version | Status | Endpoint | Not Before |
+-------------+----------------------------+---------+-----------+---------------------------------------------------------+------------+
| kr-west1 | data-flow | 1.0 | CURRENT | https://data-flow.kr-west1.e.samsungsdscloud.com | None |
| kr-west1 | data-ops | 1.0 | CURRENT | https://data-ops.kr-west1.e.samsungsdscloud.com | None |
| kr-west2 | scp-aimlops-platform | 1.0 | CURRENT | https://aimlops-platform.kr-west2.e.samsungsdscloud.com | None |
| kr-west1 | scp-aimlops-platform | 1.0 | CURRENT | https://aimlops-platform.kr-west1.e.samsungsdscloud.com | None |
| kr-west1 | scp-apigateway | 1.1 | CURRENT | https://apigateway.kr-west1.e.samsungsdscloud.com | None |
API Version Status List
| STATUS | Description |
|---|---|
| CURRENT | The latest recommended version (only one latest version is maintained) |
| SUPPORTED | Version with no new features, only bug fixes available |
| PLANNED | Preview of upcoming versions (API calls not available, for documentation only) |
| DEPRECATED | Version is deprecated; API version has 90 days or less remaining before it is no longer supported |
interactive mode
You can use the CLI by running it in interactive mode.
scp-cli <global factor>
If the global factor needs to be set, enter it at execution time to set it and enter.
global factor : factors other than those of the commands used to perform the CLI. (ex. debug, microversion, etc.)
global factor use example
scp-cli --iam-api-version 1.3 --vpc-api-version 1.3
After execution, the following prompt appears, and you can enter the command directly to execute it.
(scp-cli)
Interactive Mode Usage Example
(scp-cli) iam policy list
To exit, exit interactive mode using Ctrl + D'.