### Install a plugin from a remote URL Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Example of installing a plugin by providing its URL. ```bash ibmcloud plugin install http://example.com/downloads/my-plugin ``` -------------------------------- ### Install a plugin from the local file system Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Example of installing a plugin by specifying its path on the local file system. ```bash ibmcloud plugin install /downloads/new_plugin ``` -------------------------------- ### Example Usage of `ibmcloud project get` Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md An example of how to use the `ibmcloud project get` command with a specified project ID. This command retrieves details for the project identified by 'exampleString'. ```sh ibmcloud project get \ --id exampleString ``` -------------------------------- ### Example: Get Virtual Server Pricing Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md Fetches pricing details for Virtual Server for VPC for a Pay-As-You-Go account. ```bash ibmcloud catalog pricing is.instance [--price paygo] ``` -------------------------------- ### Install all available plug-ins Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/extend_cli.md Use the `plugin install -a` command to install all the latest available plug-ins from the repository. ```bash ibmcloud plugin install -a ``` -------------------------------- ### Install a specific plugin from the default repository Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Example of installing the 'container-service' plugin from the default repository without explicitly naming it. ```bash ibmcloud plugin install container-service ``` -------------------------------- ### Example: List API keys for a service Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md This example shows how to list all API keys for the service named 'sample-service'. ```bash ibmcloud iam service-api-keys sample-service ``` -------------------------------- ### Local Plugin Installation Output Source: https://github.com/ibm-cloud-docs/cli/blob/master/faq.md This is an example of the output you might see after successfully installing a plugin locally using the 'ibmcloud plugin install' command. ```text Installing plugin './code-engine-darwin-amd64-1.23.2'... OK Plug-in 'code-engine 1.23.2' was successfully installed into /Users/username/.bluemix/plugins/code-engine. Use 'ibmcloud plugin show code-engine' to show its details. $ ``` -------------------------------- ### Example: Get Rule Options for Context-Based Restrictions Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/cbr/context-based-restrictions.md Demonstrates how to fetch detailed rule options for the 'context-based-restrictions' service. ```sh ibmcloud cbr rule-options context-based-restrictions --api-types crn:v1:bluemix:public:context-based-restrictions::::api-type: --full ``` -------------------------------- ### Install a plugin from a local path or URL Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Install a plugin by providing its local file path or a remote URL. The '-f' flag forces the installation. ```bash ibmcloud plugin install LOCAL-PATH/TO/PLUGIN | URL [-f] ``` -------------------------------- ### Example: Get Account Settings Assignment Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example of retrieving account settings assignment with a specific ID. ```bash ibmcloud iam account-settings-assignment AccountSettingsAssignment-7c4345c7f2cb4c75a9f29b68fc1e1e88 ``` -------------------------------- ### Example Project Configuration Resources Output Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md This JSON object represents the example output when retrieving project configuration resources. ```json { "resources" : [ { "resource_crn" : "crn:v1:staging:public:toolchain:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "resource_name" : "toolchain_instance", "resource_type" : "ibm_cd_toolchain", "resource_tainted" : false, "resource_group_name" : "", "account_id" : "499b176abb3e1c9727df87ae48b27c7b", "location" : "us-south", "resource_status" : "active", "tags" : [ ], "service_tags" : [ ], "catalog_tags" : [ ] }, { "resource_crn" : "crn:v1:staging:public:cloud-object-storage:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "resource_name" : "cos_bucket_instance", "resource_type" : "ibm_cos_bucket", "resource_tainted" : false, "resource_group_name" : "", "account_id" : "499b176abb3e1c9727df87ae48b27c7b", "location" : "us-south", "resource_status" : "active", "tags" : [ ], "service_tags" : [ ], "catalog_tags" : [ ] } ], "resources_count" : 2 } ``` -------------------------------- ### Example: Preinstall Catalog Offering Version Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md An example demonstrating how to run the preinstallation script for a product version, specifying the version locator, cluster ID, and namespace. ```bash ibmcloud catalog offering version preinstall --version-locator b636d651-8489-4425-bd6a-f30af1603577.18aad484-c78b-4269-808b-52027621abd4 --cluster bn5ebho206o7fg45f2e0 --namespace test-namespace ``` -------------------------------- ### Example: Enable API key by name Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md This example shows how to enable an API key named 'test-api-key'. ```bash ibmcloud iam api-key-enable test-api-key ``` -------------------------------- ### Example: List Account Settings Assignments Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example of listing account settings assignments in the current account. ```bash ibmcloud iam account-settings-assignments ``` -------------------------------- ### List versions of account settings template example Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example command to list versions of the account settings template 'AccountSettingsEditorTemplate'. ```bash ibmcloud iam account-settings-template-versions AccountSettingsEditorTemplate ``` -------------------------------- ### Example: Create a catalog with a description Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md This example demonstrates how to create a catalog named 'dev-catalog' with a specific description for development and testing purposes. ```bash ibmcloud catalog create --name dev-catalog --catalog-description "a catalog for development and testing purposes" ``` -------------------------------- ### Install a specific plug-in Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/extend_cli.md Install a specific plug-in by its name using `ibmcloud plugin install PLUGIN_NAME`. The output shows the download progress and installation location. ```bash ibmcloud plugin install code-engine ``` ```text Looking up 'code-engine' from repository 'IBM Cloud'... Plug-in 'code-engine 1.23.2' found in repository 'IBM Cloud' Attempting to download the binary file... 54.29 MiB / 54.29 MiB [============================================] 100.00% 10s 56929376 bytes downloaded Installing binary... OK Plug-in 'code-engine 1.23.2' was successfully installed into /Users/username/.bluemix/plugins/code-engine. Use 'ibmcloud plugin show code-engine' to show its details. ``` -------------------------------- ### Example Usage of `ibmcloud project config-undeploy` Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md Example of how to use the `config-undeploy` command with specified project and configuration IDs. ```bash ibmcloud project config-undeploy \ --project-id exampleString \ --id exampleString ``` -------------------------------- ### Install all latest available plugins Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Install all the latest available plugins from the official repository using the '--all' flag. ```bash ibmcloud plugin install --all ``` -------------------------------- ### Example: Get API Types for a Service Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/cbr/context-based-restrictions.md Demonstrates how to retrieve API types for the 'context-based-restrictions' service. ```sh ibmcloud cbr api-types --service-name context-based-restrictions ``` -------------------------------- ### Example: Assign Account Settings Template to Account Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example of assigning an account settings template to a specific account. ```bash ibmcloud iam account-settings-assignment-create TemplateTest 1 Account f7fc6938256e46e1a25ee09e14ca9c20 ``` -------------------------------- ### Example: Commit Account Settings Template Version Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example of committing version 1 of the AccountSettingsEditorTemplate. ```bash ibmcloud iam account-settings-template-version-commit AccountSettingsEditorTemplate 1 ``` -------------------------------- ### Create Trusted Profile Example Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example of creating a trusted profile with a given name and description. ```bash ibmcloud iam trusted-profile-create sample-test -d "sample trusted profile" ``` -------------------------------- ### Install IBM Cloud CLI Plugin from URL Source: https://github.com/ibm-cloud-docs/cli/blob/master/faq.md Install a plugin directly from a provided URL. This is useful for installing plugins that are hosted remotely. ```bash ibmcloud plugin install http://example.com/downloads/my-plugin ``` -------------------------------- ### Show Plugin Details in Default Repository Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Example of showing details for the 'IBM-Containers' plug-in in the default repository. Note: The example provided in the source repeats the same command for both specific and default repository cases. ```bash ibmcloud plugin repo-plugin IBM-Containers -r sample-repo ``` -------------------------------- ### Example Output for Listing Project Configuration Versions Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md This is an example of the JSON response when listing project configuration versions. It shows details of approved and validated versions. ```json { "versions" : [ { "definition" : { "locator_id" : "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global" }, "version" : 1, "state" : "approved", "href" : "https://projects.api.cloud.ibm.com/v1/projects/db268db0-160b-4911-8f93-89659000a927/configs/293c3c36-a094-4115-a12b-de0a9ca39be5/versions/1" }, { "definition" : { "locator_id" : "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global" }, "version" : 2, "state" : "validated", "href" : "https://projects.api.cloud.ibm.com/v1/projects/db268db0-160b-4911-8f93-89659000a927/configs/293c3c36-a094-4115-a12b-de0a9ca39be5/versions/2" } ] } ``` -------------------------------- ### Install multiple plugins simultaneously Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Install multiple plugins, specifying versions for each, in a single command. ```bash ibmcloud plugin install container-service@1.0.506 secrets-manager@0.1.25 ``` -------------------------------- ### Install all latest available plugins from a repository Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md This command installs all the latest available plugins from the specified repository. The '-f' flag can be used to force installation without confirmation. ```bash ibmcloud plugin install [-a, --all] [-r REPO_NAME] [-f] ``` -------------------------------- ### Create an access management tag example Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_resource_group.md Example command to create an access management tag named 'project:myproject'. ```bash ibmcloud resource tag-create —tag-names "project:myproject" ``` -------------------------------- ### Example `ibmcloud project config` Command Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md This example demonstrates how to use the `ibmcloud project config` command with both `--project-id` and `--id` options specified. ```sh ibmcloud project config \ --project-id exampleString \ --id exampleString ``` -------------------------------- ### Install Software Version Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md Installs a specific software version using cluster, namespace, and override values. ```bash ibmcloud catalog install [--version-locator 1] [--cluster A] [--namespace install] [--override-values values.json] ``` -------------------------------- ### Example: Update Account Settings Template Version Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example of updating version 1 of the AccountSettingsEditorTemplate using a local JSON file. ```bash ibmcloud iam account-settings-template-version-update AccountSettingsEditorTemplate 1 --file /path/to/account_settings_template.json ``` -------------------------------- ### Example Project Delete Output Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md This is an example JSON output when a project is successfully deleted. ```json { "id" : "4059955c-ccb3-4fd3-aa48-34e3b8334f80" } ``` -------------------------------- ### Show Installed Plugin Details Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Displays detailed information about a specific installed plug-in in the IBM Cloud CLI. ```bash ibmcloud plugin show PLUGIN-NAME ``` -------------------------------- ### Install a specific plugin from the IBM Cloud repository Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Install the 'container-service' plugin, which defaults to the latest version, from the 'IBM Cloud' repository. ```bash ibmcloud plugin install container-service -r "IBM Cloud" ``` -------------------------------- ### Show details for account settings template Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example command to show details for the 'AccountSettingsEditorTemplate'. ```bash ibmcloud iam account-settings-template AccountSettingsEditorTemplate ``` -------------------------------- ### Example: Enable API key by UUID with force Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md This example demonstrates enabling an API key using its UUID and bypassing confirmation with the --force flag. ```bash ibmcloud iam api-key-enable ApiKey-18f773b0-db53-43f1-ad68-92c667c218fe --force ``` -------------------------------- ### Install Software Version Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md Install a software version from the {{site.data.keyword.cloud_notm}} catalog. This command supports various options for specifying the version, cluster, namespace, custom values, and installation behavior (e.g., wait time, deletion after validation). ```bash ibmcloud catalog install [--version-locator VERSION_NUMBER] [--cluster CLUSTER_ID] [--namespace NAME] [--override-values VALUES] [--timeout TIMEOUT] [--wait WAIT] [--workspace-name NAME] [--workspace-tags TAGS] [--workspace-tf-version VERSION] [--workspace-region REGION] [--workspace-rg-id ID] [schematics-delete VALUE] ``` -------------------------------- ### Example: Retrieve Project Stack Definition Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md An example of how to retrieve a project stack definition using its project ID and configuration ID. ```sh ibmcloud project stack-definition \ --project-id exampleString \ --id exampleString ``` -------------------------------- ### Install the catalogs management plug-in Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md Install the catalogs management plug-in for the IBM Cloud CLI. Ensure your CLI is up to date for the latest features. ```bash ibmcloud plugin install catalogs-management ``` -------------------------------- ### Example: Unlock API key by name Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md This example shows how to unlock an API key named 'test-api-key'. ```bash ibmcloud iam api-key-unlock test-api-key ``` -------------------------------- ### Example: Retrieve Offering Version Categories Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md Example of how to retrieve the category for a product named 'dev-offering' within the 'dev-catalog'. ```bash ibmcloud catalog offering version categories --catalog dev-catalog --offering dev-offering ``` -------------------------------- ### Example: Assign Account Settings Template to Account Group Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example of assigning an account settings template to a specific account group. ```bash ibmcloud iam account-settings-assignment-create TemplateTest 1 AccountGroup 955fc2274567474f8da802d5c376504b ``` -------------------------------- ### List Virtual Server Creation Options Source: https://github.com/ibm-cloud-docs/cli/blob/master/_include-segments/sl_vs.md Lists available options for creating a virtual server instance. ```bash ibmcloud sl vs options ``` -------------------------------- ### Example Output for Get Prevalidate Results Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md This JSON output shows an example response when retrieving prevalidate results. It includes details about the job, its status, and any associated messages. ```json { "cost_estimate" : { }, "cra_logs" : { "cra_version" : "2.0.4", "status" : "passed" }, "job" : { "id" : "ba98208b61efa490153b72adfd672251", "summary" : { "version" : "1.0.5", "plan_summary" : { }, "apply_summary" : { }, "destroy_summary" : { }, "message_summary" : { }, "plan_messages" : { }, "apply_messages" : { }, "destroy_messages" : { } } }, "result" : "succeeded" } ``` -------------------------------- ### Create a Service Instance with Specifics Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_resource_group.md Example of creating a service instance with a given name, service, service plan, and location. ```bash ibmcloud resource service-instance-create my-service-instance test-service test-service-plan eu-gb ``` -------------------------------- ### Example: Unlock API key by UUID with force Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md This example demonstrates unlocking an API key using its UUID and bypassing confirmation with the --force flag. ```bash ibmcloud iam api-key-unlock ApiKey-18f773b0-db53-43f1-ad68-92c667c218fe --force ``` -------------------------------- ### Call a classic infrastructure API endpoint with parameters Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_call_api.md This example demonstrates how to make a POST request to an API endpoint, including a JSON body for parameters. Replace the example path and body with your specific requirements. ```bash ibmcloud sl call-api --method POST --path /SoftLayer_Container_Virtual_Guest/createObject.json --data '{"parameters": [{"hostname": "test", "cpus": 1, "memory": 1024, "hourlyBillingFlag": true, "localDiskFlag": true, "operatingSystemReferenceCode": "UBUNTU_18_04-64", "datacenter": {"name": "dal05"}, "primaryNetworkComponent": {"networkVlanId": 123456}}]}' --output json ``` -------------------------------- ### Example JSON output for a deployable architecture configuration draft Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md This JSON represents the example response to a request for a deployable architecture configuration draft. It includes details about the project, its definition, inputs, and outputs. ```json { "id" : "293c3c36-a094-4115-a12b-de0a9ca39be5", "definition" : { "name" : "env-stage", "description" : "The stage environment configuration.", "locator_id" : "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global", "inputs" : { "account_id" : "ref:/configs/account-stage/inputs/account_id", "resource_group" : "stage", "access_tags" : [ "env:stage" ], "logdna_name" : "The name of the LogDNA stage service instance.", "sysdig_name" : "The name of the SysDig stage service instance." } }, "is_draft" : true, "version" : 2, "outputs" : [ { "name" : "resource_group_id" }, { "name" : "logdna_id" }, { "name" : "sysdig_id" } ], "project" : { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "iaas-infra-prestage-env" }, "crn" : "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a" }, "schematics" : { "workspace_crn" : "crn:v1:staging:public:schematics:us-south:a/38acaf4469814090a4e675dc0c317a0d:95ad49de-ab96-4e7d-a08c-45c38aa448e6:workspace:us-south.workspace.service.e0106139" }, "state" : "validated", "update_available" : true, "needs_attention_state" : [ ], "created_at" : "2023-02-22T19:51:23.253Z", "modified_at" : "2023-02-22T19:51:23.253Z", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/b0c44146-1ef6-40c2-82ba-74d51149770a", "deployment_model" : "project_deployed", "references" : { } } ``` -------------------------------- ### Example: Suspend a user Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_acct.md This example demonstrates how to suspend a specific user's account by providing their email and the 'SUSPENDED' status. ```bash ibmcloud account user-status-update user@ibm.com SUSPENDED ``` -------------------------------- ### Get Details for 'compliance' Service Reference Target Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/cbr/context-based-restrictions.md Example of retrieving the service reference target details for the 'compliance' service. ```shell ibmcloud cbr service-ref-target compliance ``` -------------------------------- ### Force install all latest available plugins Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Install all the latest available plugins from the official repository without confirmation by using the '--all' and '-f' flags. ```bash ibmcloud plugin install --all -f ``` -------------------------------- ### Handle SSO passcode prompt Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/bx_cli.md This is an example of the interactive prompt when logging in with a federated ID using SSO. You will be asked to open a URL in your browser to get a passcode. ```text Get One Time Code from https://identity-1.us-south.iam.cloud.ibm.com/identity/passcode to proceed. Open the URL in the default browser? [Y/n] > ``` -------------------------------- ### Install IBM Cloud CLI Plugin Locally Source: https://github.com/ibm-cloud-docs/cli/blob/master/faq.md Use this command to install a downloaded plugin binary file onto your local machine. Ensure the file path is correct. ```bash ibmcloud plugin install ./code-engine-darwin-amd64-1.23.2 ``` -------------------------------- ### Print SL Plugin Version Source: https://github.com/ibm-cloud-docs/cli/blob/master/_include-segments/sl_version.md Use this command to display the currently installed version of the SoftLayer (SL) plugin for the IBM Cloud CLI. No setup or imports are required. ```bash ibmcloud sl version ``` -------------------------------- ### Create an API key and save to file Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example of creating an API key named 'MyKey' with a description and saving its details to 'key_file'. ```bash ibmcloud iam api-key-create MyKey -d "this is my API key" --file key_file ``` -------------------------------- ### Display Bandwidth Pool Information Source: https://github.com/ibm-cloud-docs/cli/blob/master/_include-segments/sl_bandwidth.md Use this command to view information about available bandwidth pools. No specific setup is required beyond having the IBM Cloud CLI installed. ```bash ibmcloud sl bandwidth pools ``` -------------------------------- ### Get Virtual Server Usage Data Source: https://github.com/ibm-cloud-docs/cli/blob/master/_include-segments/sl_vs.md Retrieve usage data for a virtual server instance over a specified date range and metric type. The --start and --end dates are required. ```bash ibmcloud sl vs usage IDENTIFIER [flags] ``` ```bash ibmcloud sl vs usage 1234 --start 2006-01-02 --end 2006-01-02 --valid-data cpu0 ``` -------------------------------- ### Example output for retrieving a service Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/cbr/context-based-restrictions.md This is an example of the output when retrieving details for the 'context-based-restrictions' service. It shows the display name, service name, API types with their actions, and associated resource types. ```sh Display Name: Context-Based Restrictions Service Name: context-based-restrictions API Types: Name API Type ID Type Actions Description All crn:v1:bluemix:public:context-based-restrictions::::api-type: service 10 actions Protects all service APIs. Resource Types: rule zone ``` -------------------------------- ### Get Dedicated Host Order Options Source: https://github.com/ibm-cloud-docs/cli/blob/master/_include-segments/sl_dedicatedhost.md Retrieves host order options for a given dedicated host, such as available private VLANs. Requires datacenter and flavor to filter options. Use 'ibmcloud sl dedicatedhost create-options --datacenter dal05 --flavor 56_CORES_X_242_RAM_X_1_4_TB' to see an example. ```bash ibmcloud sl dedicatedhost create-options [flags] ``` -------------------------------- ### ibmcloud sl vs options Source: https://github.com/ibm-cloud-docs/cli/blob/master/_include-segments/sl_vs.md List options for creating a virtual server instance. ```APIDOC ## GET /ibmcloud/sl/vs/options ### Description List options for creating a virtual server instance. ### Method GET ### Endpoint /ibmcloud/sl/vs/options ### Response #### Success Response (200) - **availableOptions** (object) - A list of available options for VSI creation. ``` -------------------------------- ### Create account settings template with file Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example command to create an account settings template using a JSON file. ```bash ibmcloud iam account-settings-template-create AccountSettingsEditorTemplate --file /path/to/account_settings_template.json ``` -------------------------------- ### Install IBM Cloud CLI on Linux Source: https://github.com/ibm-cloud-docs/cli/blob/master/index.md Run this command to install the latest version of the IBM Cloud CLI on Linux. Ensure you have curl installed. ```bash curl -fsSL https://clis.cloud.ibm.com/install/linux | sh ``` -------------------------------- ### Install IBM Cloud CLI on macOS Source: https://github.com/ibm-cloud-docs/cli/blob/master/index.md Run this command to install the latest version of the IBM Cloud CLI on macOS. Ensure you have curl installed. ```bash curl -fsSL https://clis.cloud.ibm.com/install/osx | sh ``` -------------------------------- ### Mark Offering as Ready Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md Use this command to mark your product as ready to share or publish. Provide the version locator of the product. ```bash ibmcloud catalog offering ready --version-locator VERSION_NUMBER ``` -------------------------------- ### List Installed CLI Plugins Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Lists all plug-ins that are currently installed in the IBM Cloud CLI. It shows the installed version, availability of updates, and support for private endpoints. ```bash ibmcloud plugin list ``` -------------------------------- ### Install IBM Cloud CLI on Windows PowerShell Source: https://github.com/ibm-cloud-docs/cli/blob/master/index.md Run this command in PowerShell as an administrator to install the latest version of the IBM Cloud CLI on Windows. Ensure you have PowerShell installed. ```powershell iex (New-Object Net.WebClient).DownloadString('https://clis.cloud.ibm.com/install/powershell') ``` -------------------------------- ### Install a specific plugin version from a path or repository Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Use this command to install a specific version of a plugin from a given path or repository name. If no version is specified, the latest version is installed. ```bash ibmcloud plugin install PLUGIN_PATH|PLUGIN_NAME [-r REPO_NAME] [-v VERSION] [-f] ``` -------------------------------- ### Create a Project Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md Create a new project with specified configurations, including definition, location, and resource group. This command initiates the asynchronous setup of tools for project management. ```sh ibmcloud project create [--definition DEFINITION | --definition-name DEFINITION-NAME --definition-description DEFINITION-DESCRIPTION --definition-auto-deploy-mode DEFINITION-AUTO-DEPLOY-MODE --definition-monitoring-enabled=DEFINITION-MONITORING-ENABLED --definition-destroy-on-delete=DEFINITION-DESTROY-ON-DELETE --definition-store DEFINITION-STORE --definition-terraform-engine DEFINITION-TERRAFORM-ENGINE --definition-auto-deploy=DEFINITION-AUTO-DEPLOY] --location LOCATION --resource-group RESOURCE-GROUP [--configs CONFIGS] [--environments ENVIRONMENTS] [--output FORMAT] [-q, --quiet] ``` -------------------------------- ### SchematicsWorkspace Schema Example Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md Provides an example of the SchematicsWorkspace object, including its CRN. ```json { "workspace_crn" : "crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::" } ``` -------------------------------- ### Preinstall Catalog Offering Version Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md Run the preinstallation script for a specific version of a product in your private catalog. This prepares the environment for installation. ```bash ibmcloud catalog offering version preinstall --version-locator VERSION_NUMBER --cluster CLUSTER_ID --namespace NAME ``` -------------------------------- ### Example Project Output Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md This JSON output represents a sample response when retrieving a project, including its definition and associated configurations. ```json { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "created_at" : "2023-02-22T19:51:23.253Z", "modified_at" : "2023-02-22T19:51:23.253Z", "href" : "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "acme-microservice", "description" : "A microservice to deploy on top of ACME infrastructure.", "auto_deploy_mode" : "manual_approval", "auto_deploy" : false, "destroy_on_delete" : true, "monitoring_enabled" : false }, "configs" : [ { "id" : "673d79e4-52bf-4184-b8e9-d3ca3c110f96", "created_at" : "2023-02-22T19:51:23.253Z", "deployment_model" : "project_deployed", "definition" : { "name" : "common-variables", "description" : "The common-variables configuration." }, "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/673d79e4-52bf-4184-b8e9-d3ca3c110f96", "is_draft" : true, "project" : { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "iaas-infra-prestage-env" }, "crn" : "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a" }, "state" : "draft", "modified_at" : "2023-02-22T19:51:23.253Z", "update_available" : false, "version" : 1 }, { "id" : "4a1d4ba2-54ba-43a7-975a-d82b5a7612d1", "created_at" : "2023-02-22T19:51:23.253Z", "deployment_model" : "project_deployed", "definition" : { "name" : "account-stage", "description" : "The stage account configuration. The stage account hosts test environments prestage, performance, stage. This configuration configures services that are common to all these environments and regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the terraform modules that a Schematics workspace can deploy." }, "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/4a1d4ba2-54ba-43a7-975a-d82b5a7612d1", "is_draft" : true, "project" : { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "iaas-infra-prestage-env" }, "crn" : "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a" }, "state" : "draft", "update_available" : false, "modified_at" : "2023-02-22T19:51:23.253Z", "version" : 1 }, { "id" : "293c3c36-a094-4115-a12b-de0a9ca39be5", "created_at" : "2023-02-22T19:51:23.253Z", "deployment_model" : "project_deployed", "definition" : { "name" : "env-stage", "description" : "The stage environment configuration. It includes services that are common to all the environment regions. A blueprint must be used to configure all the services that are common to the stage regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the Terraform modules that a Schematics workspace can deploy." }, "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-de0a9ca39be5/configs/293c3c36-a094-4115-a12b-de0a9ca39be5", "is_draft" : true, "project" : { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "iaas-infra-prestage-env" }, "crn" : "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a" }, "state" : "draft", "update_available" : false, "modified_at" : "2023-02-22T19:51:23.253Z", "version" : 1 }, { "id" : "596e8656-9d4b-41a5-8340-b0cbe8bd374a", "created_at" : "2023-02-22T19:51:23.253Z", "deployment_model" : "project_deployed", "definition" : { "name" : "region-us-south-stage", "description" : "The stage `us-south` configuration. A blueprint must be used to configure the Virtual Private Cloud and Red Hat OpenShift stage `us-south`." }, "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/596e8656-9d4b-41a5-8340-b0cbe8bd374a", "is_draft" : true, "project" : { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "iaas-infra-prestage-env" }, "crn" : "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a" }, "state" : "draft", "update_available" : false, "modified_at" : "2023-02-22T19:51:23.253Z", "version" : 1 } ] } ``` -------------------------------- ### Install Context-based restrictions plug-in Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/cbr/context-based-restrictions.md Installs the context-based restrictions plug-in for the IBM Cloud CLI. ```APIDOC ## Install Context-based restrictions plug-in ### Description Installs the context-based restrictions plug-in for the IBM Cloud CLI. ### Command ```bash ibmcloud plugin install cbr ``` ``` -------------------------------- ### Example Project Output Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/projects/projects-cli.md This JSON output represents a sample response when retrieving a project, including its configurations. It details project metadata, definition, and associated configuration objects. ```json { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "created_at" : "2023-02-22T19:51:23.253Z", "modified_at" : "2023-02-22T19:51:23.253Z", "href" : "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "acme-microservice", "description" : "A microservice to deploy on top of ACME infrastructure.", "auto_deploy_mode" : "manual_approval", "auto_deploy" : false, "destroy_on_delete" : true, "monitoring_enabled" : false }, "configs" : [ { "id" : "673d79e4-52bf-4184-b8e9-d3ca3c110f96", "created_at" : "2023-02-22T19:51:23.253Z", "deployment_model" : "project_deployed", "definition" : { "name" : "common-variables", "description" : "The common-variables configuration." }, "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/673d79e4-52bf-4184-b8e9-d3ca3c110f96", "is_draft" : true, "project" : { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "iaas-infra-prestage-env" }, "crn" : "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a" }, "state" : "draft", "modified_at" : "2023-02-22T19:51:23.253Z", "update_available" : false, "version" : 1 }, { "id" : "4a1d4ba2-54ba-43a7-975a-d82b5a7612d1", "created_at" : "2023-02-22T19:51:23.253Z", "deployment_model" : "project_deployed", "definition" : { "name" : "account-stage", "description" : "The stage account configuration. The stage account hosts test environments prestage, performance, stage. This configuration configures services that are common to all these environments and regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the terraform modules that a Schematics workspace can deploy." }, "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/4a1d4ba2-54ba-43a7-975a-d82b5a7612d1", "is_draft" : true, "project" : { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "iaas-infra-prestage-env" }, "crn" : "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a" }, "state" : "draft", "update_available" : false, "modified_at" : "2023-02-22T19:51:23.253Z", "version" : 1 }, { "id" : "293c3c36-a094-4115-a12b-de0a9ca39be5", "created_at" : "2023-02-22T19:51:23.253Z", "deployment_model" : "project_deployed", "definition" : { "name" : "env-stage", "description" : "The stage environment configuration. It includes services that are common to all the environment regions. A blueprint must be used to configure all the services that are common to the stage regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the Terraform modules that a Schematics workspace can deploy." }, "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5", "is_draft" : true, "project" : { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "iaas-infra-prestage-env" }, "crn" : "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a" }, "state" : "draft", "update_available" : false, "modified_at" : "2023-02-22T19:51:23.253Z", "version" : 1 }, { "id" : "596e8656-9d4b-41a5-8340-b0cbe8bd374a", "created_at" : "2023-02-22T19:51:23.253Z", "deployment_model" : "project_deployed", "definition" : { "name" : "region-us-south-stage", "description" : "The stage `us-south` configuration. A blueprint must be used to configure the Virtual Private Cloud and Red Hat OpenShift stage `us-south`." }, "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/596e8656-9d4b-41a5-8340-b0cbe8bd374a", "is_draft" : true, "project" : { "id" : "cfbf9050-ab8e-ac97-b01b-ab5af830be8a", "definition" : { "name" : "iaas-infra-prestage-env" }, "crn" : "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::", "href" : "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a" } } ] } ``` -------------------------------- ### Create a Service Instance Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_resource_group.md Define the command structure for creating a new service instance, including required parameters like name, service, plan, and location, along with optional parameters for deployment, configuration, and resource group. ```bash ibmcloud resource service-instance-create NAME (SERVICE_NAME | SERVICE_ID) SERVICE_PLAN_NAME LOCATION [-d, --deployment DEPLOYMENT_NAME] [-p, --parameters @JSON_FILE | JSON_STRING ] [-g RESOURCE_GROUP] [--service-endpoints SERVICE_ENDPOINTS_TYPE] [--allow-cleanup] [--lock] [--subscription SUBSCRIPTION_ID] ``` -------------------------------- ### Example: Delete Account Settings Template Version Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_api_policy.md Example of deleting version 2 of the AccountSettingsEditorTemplate. ```bash ibmcloud iam account-settings-template-delete AccountSettingsEditorTemplate 2 ``` -------------------------------- ### Create a virtual server Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_virtual_server.md Create a new virtual server instance. You must specify parameters such as hostname, domain, and the datacenter to deploy the server in. ```bash ibmcloud sl vs create --hostname my_vs --domain my_domain.com --datacenter dal10 --size 1000 --image UBUNTU_18_04 --keyname "my_ssh_key" ``` -------------------------------- ### List Products in a Specific Catalog Source: https://github.com/ibm-cloud-docs/cli/blob/master/plugins/catalogs/manage-catalogs.md This example demonstrates how to list all products available within a specified catalog using the `ibmcloud catalog offering list` command. ```bash ibmcloud catalog offering list --catalog dev-catalog ``` -------------------------------- ### Remove 'ibmcloud-repo' Repository Example Source: https://github.com/ibm-cloud-docs/cli/blob/master/reference/ibmcloud/cli_plugin.md Example of removing the 'ibmcloud-repo' repository from the IBM Cloud CLI. ```bash ibmcloud plugin repo-remove ibmcloud-repo ```