# BTP CLI Service Manager Commands The SAP BTP CLI (`btp`) provides service management commands as an alternative to SMCTL. **Documentation**: [https://github.com/SAP-docs/sap-btp-service-manager/tree/main/docs/Service-Consumption/SAP-Service-Manager](https://github.com/SAP-docs/sap-btp-service-manager/tree/main/docs/Service-Consumption/SAP-Service-Manager) --- ## Table of Contents 1. [Prerequisites](#prerequisites) 2. [Service Instance Commands](#service-instance-commands) - [btp create services/instance](#btp-create-servicesinstance) - [btp get services/instance](#btp-get-servicesinstance) - [btp list services/instances](#btp-list-servicesinstances) - [btp delete services/instance](#btp-delete-servicesinstance) - [btp update services/instance](#btp-update-servicesinstance) 3. [Service Binding Commands](#service-binding-commands) - [btp create services/binding](#btp-create-servicesbinding) - [btp get services/binding](#btp-get-servicesbinding) - [btp list services/bindings](#btp-list-servicesbindings) - [btp delete services/binding](#btp-delete-servicesbinding) 4. [Platform Commands](#platform-commands) - [btp list services/platform](#btp-list-servicesplatform) - [btp register services/platform](#btp-register-servicesplatform) - [btp unregister services/platform](#btp-unregister-servicesplatform) - [btp get services/platform](#btp-get-servicesplatform) 5. [Marketplace Commands](#marketplace-commands) - [btp list services/offering](#btp-list-servicesoffering) - [btp list services/plan](#btp-list-servicesplan) 6. [Common Examples](#common-examples) 7. [Migration from SMCTL](#migration-from-smctl) --- ## Prerequisites 1. Install BTP CLI: [https://tools.hana.ondemand.com/#cloud](https://tools.hana.ondemand.com/#cloud) 2. Login: `btp login` 3. Set target: `btp target --subaccount ` --- ## Service Instance Commands ### btp create services/instance Create a new service instance. **Syntax**: ```bash btp create services/instance [parameters] ``` **Required Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID (skip if target set) | | `-s, --service ` | Service name | | `-p, --plan ` | Service plan ID | **Optional Parameters**: | Parameter | Description | |-----------|-------------| | `--parameters ` | JSON configuration | | `-l, --labels ` | Labels as JSON | **Label Format**: ```json {"": [""]} ``` - Keys: max 100 chars, alphanumeric + `.` `_` `-` - Values: arrays of unique strings, max 255 chars each **Examples**: ```bash # Basic creation btp create services/instance \ --subaccount abc-123 \ --service xsuaa \ --plan application # With parameters btp create services/instance \ --subaccount abc-123 \ --service hana \ --plan hdi-shared \ --parameters '{"database_id":"db-123"}' # With labels btp create services/instance \ --subaccount abc-123 \ --service xsuaa \ --plan application \ --labels '{"environment":["production"],"team":["platform"]}' ``` --- ### btp get services/instance Get details of a service instance. **Syntax**: ```bash btp get services/instance [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `` | Service instance ID | | `-sa, --subaccount ` | Subaccount ID | | `--show-parameters` | Display configuration parameters | **Example**: ```bash btp get services/instance inst-123 \ --subaccount abc-123 \ --show-parameters ``` --- ### btp list services/instance List all service instances. **Syntax**: ```bash btp list services/instance [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID | | `--labels-filter ` | Filter by labels (e.g., `landscape eq 'production'`) | | `--fields-filter ` | Filter by fields (e.g., `usable eq 'true'`) | **Example**: ```bash btp list services/instance --subaccount abc-123 --fields-filter "ready eq 'true'" ``` --- ### btp update services/instance Update a service instance. **Syntax**: ```bash btp update services/instance [parameters] ``` **Required Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID (skip if target set) | | `-s, --service` or `-n, --name ` | Service instance name | | `-id ` | Service instance ID | **Optional Parameters**: | Parameter | Description | |-----------|-------------| | `--new-name ` | New name for the instance | | `-p, --plan ` | New service plan ID | | `--plan-name ` | New service plan name | | `--parameters ` | New parameters as JSON | | `-l, --labels ` | New labels | **Note**: Plan updates only available if additional plans exist and are entitled. --- ### btp delete services/instance Delete a service instance. **Syntax**: ```bash btp delete services/instance [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `` | Service instance ID | | `-sa, --subaccount ` | Subaccount ID | | `--confirm` | Skip confirmation | --- ## Service Binding Commands ### btp create services/binding Create a service binding. **Syntax**: ```bash btp create services/binding [parameters] ``` **Required Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID | | `-b, --binding ` or `-n, --name ` | Binding name | | `-si, --service-instance ` or `--instance-name ` | Service instance | **Optional Parameters**: | Parameter | Description | |-----------|-------------| | `--parameters ` | Binding parameters | | `-l, --labels ` | Labels | **Examples**: ```bash # Basic binding btp create services/binding \ --subaccount abc-123 \ --binding my-binding \ --service-instance inst-123 # With X.509 credentials btp create services/binding \ --subaccount abc-123 \ --name my-binding \ --instance-name my-instance \ --parameters '{"credential-type":"x509"}' ``` --- ### btp get services/binding Get binding details. **Syntax**: ```bash btp get services/binding [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `` | Binding ID | | `-sa, --subaccount ` | Subaccount ID | | `--show-parameters` | Display parameters | --- ### btp list services/binding List all bindings. **Syntax**: ```bash btp list services/binding [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID | | `--labels-filter ` | Filter by labels (e.g., `purpose eq 'backing services'`) | | `--fields-filter ` | Filter by fields (e.g., `ready eq 'true'`) | --- ### btp delete services/binding Delete a binding. **Syntax**: ```bash btp delete services/binding [parameters] ``` --- ## Platform Commands ### btp list services/platform List all registered platforms. **Syntax**: ```bash btp list services/platform [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID | | `--labels-filter ` | Filter by labels | | `--fields-filter ` | Filter by fields | --- ### btp get services/platform Get platform details. **Syntax**: ```bash btp get services/platform [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `` | Platform ID | | `-sa, --subaccount ` | Subaccount ID | **Output**: ID, Name, Type, Description, URL, Created, Updated, Labels --- ### btp register services/platform Register a new platform (Kubernetes only). **Syntax**: ```bash btp register services/platform [parameters] ``` **Required Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID | | `-n, --name ` | Platform name (alphanumeric + hyphens, must be unique) | | `-t, --type ` | Platform type (only `kubernetes` supported) | **Optional Parameters**: | Parameter | Description | |-----------|-------------| | `--id ` | Custom platform ID (globally unique) | | `-d, --description ` | Description | | `-l, --labels ` | Labels as JSON | **Example**: ```bash btp register services/platform \ --subaccount abc-123 \ --name my-k8s \ --type kubernetes \ --description "Production cluster" ``` **Output**: Platform credentials (username/password) returned on success. --- ### btp update services/platform Update a platform. **Syntax**: ```bash btp update services/platform [parameters] ``` --- ### btp unregister services/platform Unregister a platform. **Syntax**: ```bash btp unregister services/platform --subaccount ``` --- ## Broker Commands ### btp list services/broker List all registered brokers. **Syntax**: ```bash btp list services/broker [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID | | `--labels-filter ` | Filter by labels | | `--fields-filter ` | Filter by fields | **Output**: ID, Name, Description, Broker URL, Created, Updated, Labels --- ### btp get services/broker Get broker details. **Syntax**: ```bash btp get services/broker [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `` | Broker ID | | `-sa, --subaccount ` | Subaccount ID | **Output**: ID, Name, Description, Broker URL, Created, Updated, Labels --- ### btp register services/broker Register a service broker. **Syntax**: ```bash btp register services/broker [parameters] ``` **Required Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID | | `-n, --name ` | Broker name (alphanumeric + hyphens, must be unique) | | `--url ` | Broker URL | | `-u, --user ` | Auth username | | `-p, --password ` | Auth password | **Optional Parameters**: | Parameter | Description | |-----------|-------------| | `-d, --description ` | Description | | `-l, --labels ` | Labels as JSON | **Label Format**: - Keys: max 100 chars, alphanumeric + `.` `_` `-` - Values: arrays of strings, max 255 chars each, no newlines --- ### btp unregister services/broker Unregister a broker. **Syntax**: ```bash btp unregister services/broker --subaccount ``` --- ## Offering Commands ### btp list services/offering List available service offerings. **Syntax**: ```bash btp list services/offering [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID | | `--environment ` | Filter by environment: `cloudfoundry` or `kubernetes` | | `--labels-filter ` | Filter by labels (e.g., `environment eq 'test'`) | | `--fields-filter ` | Filter by fields | **Note**: Without `--environment`, returns services consumable through Service Manager bindings. --- ### btp get services/offering Get offering details. **Syntax**: ```bash btp get services/offering [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `` | Offering ID | | `-sa, --subaccount ` | Subaccount ID | --- ## Plan Commands ### btp list services/plan List available service plans. **Syntax**: ```bash btp list services/plan [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `-sa, --subaccount ` | Subaccount ID | | `--environment ` | Filter by environment: `cloudfoundry` or `kubernetes` | | `--labels-filter ` | Filter by labels | | `--fields-filter ` | Filter by fields | --- ### btp get services/plan Get plan details. **Syntax**: ```bash btp get services/plan [parameters] ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `` | Plan ID | | `-sa, --subaccount ` | Subaccount ID | --- ## Common Patterns ### Set Target (Skip Subaccount on Each Command) ```bash # Set target once btp target --subaccount abc-123 # Now commands don't need --subaccount btp list services/instance btp create services/instance --service xsuaa --plan application ``` ### JSON Output ```bash btp --format json list services/instance ``` ### Parameters from File ```bash btp create services/instance \ --service hana \ --plan hdi-shared \ --parameters @params.json ``` --- ## SMCTL vs BTP CLI Comparison | Operation | SMCTL | BTP CLI | |-----------|-------|---------| | Login | `smctl login` | `btp login` | | Create instance | `smctl provision` | `btp create services/instance` | | Delete instance | `smctl deprovision` | `btp delete services/instance` | | Create binding | `smctl bind` | `btp create services/binding` | | List instances | `smctl list-instances` | `btp list services/instance` | | Marketplace | `smctl marketplace` | `btp list services/offering` | **Recommendation**: Use SMCTL for Service Manager-specific operations; use BTP CLI for unified BTP management. --- ## Documentation Links - **Create Instance**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/create-services-instance-5a44ad8.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/create-services-instance-5a44ad8.md) - **Create Binding**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/create-services-binding-7cf9dc5.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/create-services-binding-7cf9dc5.md) - **Get Instance**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/get-services-instance-adb4c54.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/get-services-instance-adb4c54.md) - **Platform Commands**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/platforms-7610c08.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/platforms-7610c08.md)