Back to skills
SkillHub ClubShip Full StackFull Stack

sap-btp-service-manager

Imported from https://github.com/secondsky/sap-skills.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
152
Hot score
96
Updated
March 20, 2026
Overall rating
C3.4
Composite score
3.4
Best-practice grade
F19.6

Install command

npx @skill-hub/cli install secondsky-sap-skills-sap-btp-service-manager

Repository

secondsky/sap-skills

Skill path: plugins/sap-btp-service-manager/skills/sap-btp-service-manager

Imported from https://github.com/secondsky/sap-skills.

Open repository

Best for

Primary workflow: Ship Full Stack.

Technical facets: Full Stack.

Target audience: everyone.

License: GPL-3.0.

Original source

Catalog source: SkillHub Club.

Repository owner: secondsky.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install sap-btp-service-manager into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/secondsky/sap-skills before adding sap-btp-service-manager to shared team environments
  • Use sap-btp-service-manager for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: sap-btp-service-manager
description: |
  This skill provides comprehensive knowledge for SAP Service Manager on SAP Business Technology Platform (BTP). It should be used when managing service instances, bindings, brokers, and platforms across Cloud Foundry, Kyma, Kubernetes, and other environments. Use when provisioning services via SMCTL CLI, BTP CLI, or REST APIs, configuring OAuth2 authentication, working with the SAP BTP Service Operator in Kubernetes, troubleshooting service consumption issues, or implementing cross-environment service management.

  Keywords: SAP Service Manager, BTP, service instances, service bindings, SMCTL, service broker, OSBAPI, Cloud Foundry, Kyma, Kubernetes, service-manager, service-operator-access, subaccount-admin, OAuth2, X.509, service marketplace, service plans, rate limiting, cf create-service, btp create services/instance, ServiceInstance CRD, ServiceBinding CRD
license: GPL-3.0
metadata:
  version: 1.1.1
  last_verified: 2025-11-27
  documentation_source: [https://github.com/SAP-docs/sap-btp-service-manager](https://github.com/SAP-docs/sap-btp-service-manager)
  documentation_files_analyzed: 80+
  reference_files: 6
  template_files: 5
  status: production
  important_notes: SMCLI repository archived (2025-09-30) - Go installation recommended
---

# SAP BTP Service Manager Skill

## Related Skills

- **sap-btp-cloud-platform**: Use for platform fundamentals, service understanding, and BTP integration
- **sap-btp-best-practices**: Use for production deployment patterns and service management guidelines
- **sap-btp-connectivity**: Use for destination configuration when services require connectivity setup
- **sap-cap-capire**: Use for CAP service provisioning and binding management

Comprehensive skill for managing services across SAP BTP environments using SAP Service Manager.

---

## Table of Contents
- [When to Use This Skill](#when-to-use-this-skill)
- [Quick Start](#quick-start)
- [Core Concepts](#core-concepts)
- [Cloud Foundry Operations](#cloud-foundry-operations)
- [Kubernetes Operations](#kubernetes-operations)
- [SMCTL CLI Reference](#smctl-cli-reference)
- [API Reference](#api-reference)
- [Bundled Resources](#bundled-resources)

## When to Use This Skill

Use this skill when working on tasks involving:

**Service Instance Management**:
- Creating service instances in Cloud Foundry, Kyma, Kubernetes, or other environments
- Provisioning services via SAP BTP cockpit, SMCTL CLI, or BTP CLI
- Configuring service parameters and labels
- Deleting service instances and managing lifecycle

**Service Binding Management**:
- Creating bindings to deliver credentials to applications
- Binding service instances to Cloud Foundry applications
- Creating service keys for external client access
- Managing Kubernetes ServiceBinding CRDs

**Platform & Broker Management**:
- Registering platforms (OSBAPI-enabled systems)
- Registering service brokers
- Managing broker catalogs and offerings
- Updating and deleting platform/broker registrations

**Authentication & Authorization**:
- Configuring OAuth2 client credentials
- Working with X.509 certificate authentication
- Assigning Subaccount Service Administrator role
- Managing service manager plans and scopes

**Kubernetes/Kyma Integration**:
- Setting up SAP BTP Service Operator
- Creating ServiceInstance and ServiceBinding CRDs
- Migrating from Service Catalog (svcat) to SAP BTP Service Operator
- Installing cert-manager for operator communication

**API & CLI Operations**:
- Using SMCTL command-line interface
- Using BTP CLI for service management
- Working with Service Manager REST APIs
- Filtering and querying service resources

**Troubleshooting**:
- Debugging service provisioning failures
- Resolving binding credential issues
- Handling rate limiting (HTTP 429)
- Checking async operation status

---

## Quick Start

### 1. Install SMCTL CLI

**⚠️ Important**: The SMCLI repository was archived on September 30, 2025. While the tool remains functional, consider migration strategies for long-term SAP BTP workflows.

**Recommended Method (Go)**:
```bash
# Install via Go (preferred approach)
go install github.com/Peripli/service-manager-cli@latest

# Add to PATH (if not already)
export PATH=$PATH:$(go env GOPATH)/bin
smctl --version
```

**Alternative Method (Prebuilt Binary)**:
```bash
# Download from: [https://github.com/Peripli/service-manager-cli/releases/latest](https://github.com/Peripli/service-manager-cli/releases/latest)
tar -xzf smctl-*.tar.gz && chmod +x smctl
sudo mv smctl /usr/local/bin/ && smctl --version
```

**Note**: While the prebuilt binary method remains functional, the Go installation approach is officially recommended. Consider evaluating SAP's native BTP CLI as an alternative for new deployments.

### 2. Login
```bash
# Interactive login
smctl login -a [https://service-manager.cfapps.<region>.hana.ondemand.com](https://service-manager.cfapps.<region>.hana.ondemand.com) \
  --param subdomain=<subdomain>

# Client credentials
smctl login -a [https://service-manager.cfapps.<region>.hana.ondemand.com](https://service-manager.cfapps.<region>.hana.ondemand.com) \
  --param subdomain=<subdomain> --auth-flow client-credentials \
  --client-id <id> --client-secret <secret>
```

### 3. Basic Operations
```bash
# Browse services
smctl marketplace

# Create instance (async)
smctl provision my-instance <service> <plan>

# Create binding
smctl bind my-instance my-binding
```

---

## Core Concepts

### Service Manager Architecture

SAP Service Manager is the **central registry for service brokers and platforms** in SAP BTP.

**Primary Resources**:
- **Platforms** - OSBAPI-enabled systems where applications run
- **Service Brokers** - Intermediaries advertising service catalogs
- **Service Instances** - Individual service instantiations
- **Service Bindings** - Access credentials for instances
- **Service Plans** - Capability sets offered by services
- **Service Offerings** - Service advertisements from brokers

### Service Manager Plans

| Plan | Purpose | Scopes |
|------|---------|--------|
| **subaccount-admin** | Full management | 10 scopes (manage + read) |
| **subaccount-audit** | Read-only monitoring | 6 scopes |
| **container** | Isolated management | 7 scopes |

### Roles

- **Subaccount Service Administrator** - Full CRUD on resources
- **Subaccount Service Viewer** - Read-only access (Feature Set B)

---

## Cloud Foundry Operations

### Service Instance & Binding

**Via Cockpit**: Services > Instances > Create > Select service/plan > Cloud Foundry runtime

**Via CF CLI**:
```bash
# Create instance
cf create-service <service> <plan> <instance-name>

# Bind to app
cf bind-service <app-name> <instance-name>

# Create service key (external access)
cf create-service-key <instance-name> <key-name>
```

---

## Kubernetes Operations

### Prerequisites
- Kubernetes cluster with kubectl v1.7+
- Helm v3.1.2+
- SMCTL v1.10.1+

### Setup Service Operator

**1. Install cert-manager**:
```bash
kubectl apply -f [https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml](https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml)
```

**2. Create Service Manager resources**:
```bash
smctl provision sm-operator service-manager service-operator-access --mode sync
smctl bind sm-operator sm-operator-binding --mode sync
smctl get-binding sm-operator-binding -o json
```

**3. Deploy operator**:
```bash
helm repo add sap-btp-operator [https://sap.github.io/sap-btp-service-operator/](https://sap.github.io/sap-btp-service-operator/)
helm install sap-btp-operator sap-btp-operator/sap-btp-operator \
  --namespace sap-btp-operator --create-namespace \
  --set manager.secret.clientid=<id> \
  --set manager.secret.clientsecret=<secret>
```

### Create Resources

**ServiceInstance**:
```yaml
apiVersion: services.cloud.sap.com/v1alpha1
kind: ServiceInstance
metadata:
  name: my-service-instance
spec:
  serviceOfferingName: <service-offering>
  servicePlanName: <plan-name>
```

**ServiceBinding**:
```yaml
apiVersion: services.cloud.sap.com/v1alpha1
kind: ServiceBinding
metadata:
  name: my-binding
spec:
  serviceInstanceName: my-service-instance
```

**Reference**: See `references/kubernetes-operator.md` for complete guide.

---

## BTP CLI Operations

Alternative to SMCTL using the unified BTP CLI:

```bash
# Create instance
btp create services/instance \
  --subaccount <subaccount-id> \
  --service <service-name> \
  --plan <plan-id> \
  --parameters '{"key":"value"}' \
  --labels '{"env":["dev"]}'

# Get instance details
btp get services/instance <instance-id> \
  --subaccount <subaccount-id> \
  --show-parameters

# Create binding
btp create services/binding \
  --subaccount <subaccount-id> \
  --binding <binding-name> \
  --service-instance <instance-id>

# Platform management
btp list services/platform --subaccount <id>
btp register services/platform --subaccount <id> --name <name> --type <type>
btp unregister services/platform <platform-id> --subaccount <id>
```

---

## API Operations

### Retrieve OAuth2 Token

```bash
curl '<uaa_url>/oauth/token' -X POST \
  -H 'Accept: application/json' \
  -d 'grant_type=client_credentials&client_id=<clientid>&client_secret=<clientsecret>'
```

Response:
```json
{
  "access_token": "<token>",
  "token_type": "bearer",
  "expires_in": 43199,
  "scope": "<xsappname>.job.read <xsappname>.event.read"
}
```

### API Base URI

`[https://service-manager.cfapps.<region>.hana.ondemand.com/v1/`](https://service-manager.cfapps.<region>.hana.ondemand.com/v1/`)

### Rate Limiting

Three concurrent tiers enforced:
- **Level 1**: All APIs - 10,000/hour, 1,000/minute
- **Level 2**: Resource-specific - 1,000-6,000/hour
- **Level 3**: Instance operations - 50-6,000/hour

HTTP 429 returned with `Retry-After` header when limits exceeded.

### Filtering

Query parameters:
- `fieldQuery` - Filter by resource attributes
- `labelQuery` - Filter by resource labels
- Operators: `eq`, `ne`, `in`, `contains`, etc.

**Reference**: See `references/rate-limiting-filtering.md` for complete rate limits and filtering details.

---

## SMCTL Command Reference

### Key Commands
| Category | Commands | Description |
|----------|----------|-------------|
| **Authentication** | `login`, `logout` | Manage sessions |
| **Instances** | `provision`, `deprovision`, `list-instances` | Service instance lifecycle |
| **Bindings** | `bind`, `unbind`, `list-bindings` | Service binding management |
| **Brokers** | `register-broker`, `update-broker` | Service broker operations |
| **Platforms** | `register-platform`, `list-platforms` | Platform registration |
| **Marketplace** | `marketplace` | Browse service offerings |

### Common Flags
- `--mode sync/async` - Execution mode (default: async)
- `-c, --parameters` - JSON configuration
- `-o, --output` - Output format (json, yaml, text)
- `-v, --verbose` - Detailed output

**Reference**: See `references/smctl-commands.md` for complete command reference with all flags and examples.

---

## Common Operations

### Check Async Operation Status

```bash
# Get operation URL from provision/bind response
smctl status /v1/service_instances/<id>/operations/<op-id>
```

API:
```
GET /v1/{resourceType}/{resourceID}/operations/{operationID}
```

Response states: `in progress`, `succeeded`, `failed`

### Delete Service Instance

**Prerequisites**:
1. Remove all service bindings
2. Remove all service keys
3. Instance not bound to applications

```bash
# Force delete without confirmation
smctl deprovision my-instance -f

# Sync mode
smctl deprovision my-instance --mode sync
```

**Note**: Kyma/Kubernetes instances cannot be deleted from BTP cockpit.

### Assign Administrator Role

1. Navigate to subaccount > Security > Trust Configuration > SAP ID Service
2. Enter user email
3. Click Show Assignments > Add User
4. Assign Role Collection > Select "Subaccount Service Administrator"

---

## Troubleshooting

### Issue: Cannot see service in marketplace

**Check**:
1. Service entitlement added to subaccount?
2. Quota assigned (enterprise accounts)?
3. Correct region selected?

### Issue: Instance creation fails

**Check**:
1. Valid plan selected?
2. Parameters JSON syntax correct?
3. Quota not exceeded?
4. Required dependencies provisioned?

**Debug**:
```bash
smctl get-instance <name> -o json
# Check "last_operation" for error details
```

### Issue: Rate limit exceeded (HTTP 429)

**Solution**:
1. Check `Retry-After` header
2. Implement exponential backoff
3. Batch operations where possible
4. Consider caching responses

### Issue: Binding credentials missing

**Check**:
1. Binding completed successfully?
2. Correct binding name referenced?
3. Secret created (Kubernetes)?

```bash
# SMCTL
smctl get-binding <name> -o json

# Kubernetes
kubectl get secrets <binding-name> -o yaml
```

### Issue: X.509 authentication fails

**Check**:
1. Certificate not expired?
2. Correct certificate/key pair?
3. Certificate chain complete?
4. Client ID matches certificate?

---

## Best Practices

### 1. Use Sync Mode for Scripts
```bash
smctl provision my-instance service plan --mode sync
```

### 2. Label Resources
```bash
smctl provision my-instance service plan \
  -c '{}' \
  --labels '{"environment":"production","team":"platform"}'
```

### 3. Use Service Keys for External Access
Instead of binding to apps, create service keys for external clients.

### 4. Implement Retry Logic
For async operations, poll status with exponential backoff.

### 5. Choose Appropriate Plans
- `subaccount-admin`: Full management
- `subaccount-audit`: Read-only monitoring
- `container`: Isolated per-instance access

### 6. Secure Credentials
- Rotate service keys periodically
- Use X.509 for production
- Store credentials in secret managers

---

## Bundled Resources

### Templates (5 files)
Ready-to-use templates in `templates/` directory:
- **service-instance-cf.json** - Cloud Foundry instance parameters
- **service-binding-cf.json** - Cloud Foundry binding parameters
- **service-instance-k8s.yaml** - Kubernetes ServiceInstance CRD
- **service-binding-k8s.yaml** - Kubernetes ServiceBinding CRD
- **oauth-token-request.sh** - OAuth2 token retrieval script

### Reference Documentation (7 files)
Detailed documentation in `references/` directory:
1. **api-reference.md** - Complete API endpoints, operations, and examples
2. **smctl-commands.md** - Full SMCTL CLI reference with all flags and usage
3. **btp-cli-commands.md** - Comprehensive BTP CLI command reference
4. **kubernetes-operator.md** - Service Operator setup, CRDs, migration guide
5. **rate-limiting-filtering.md** - Rate limits, filtering, and best practices
6. **roles-permissions.md** - Plans, roles, scopes, and authorization details
7. **service-catalog-legacy.md** - Legacy svcat and broker proxy setup (deprecated)

### Quick Reference Templates



---

## Official Documentation Links

### Primary Resources
- **GitHub Docs**: [https://github.com/SAP-docs/sap-btp-service-manager/tree/main/docs](https://github.com/SAP-docs/sap-btp-service-manager/tree/main/docs)
- **SAP Help Portal**: [https://help.sap.com/docs/service-manager](https://help.sap.com/docs/service-manager)
- **SMCTL Releases**: [https://github.com/Peripli/service-manager-cli/releases](https://github.com/Peripli/service-manager-cli/releases)
- **Service Operator**: [https://github.com/SAP/sap-btp-service-operator](https://github.com/SAP/sap-btp-service-operator)

### API Documentation
- **Swagger UI**: `[https://service-manager.cfapps.<region>.hana.ondemand.com/swaggerui/swagger-ui.html`](https://service-manager.cfapps.<region>.hana.ondemand.com/swaggerui/swagger-ui.html`)
- **Regions**: [https://help.sap.com/docs/btp/sap-business-technology-platform/regions-and-api-endpoints-available-for-cloud-foundry-environment](https://help.sap.com/docs/btp/sap-business-technology-platform/regions-and-api-endpoints-available-for-cloud-foundry-environment)

### Related Documentation
- **BTP Cockpit**: [https://cockpit.btp.cloud.sap/](https://cockpit.btp.cloud.sap/)
- **cert-manager**: [https://cert-manager.io/docs/installation/kubernetes/](https://cert-manager.io/docs/installation/kubernetes/)
- **Kyma Services**: [https://help.sap.com/docs/btp/sap-business-technology-platform/using-services-in-kyma-environment](https://help.sap.com/docs/btp/sap-business-technology-platform/using-services-in-kyma-environment)

---

## Instructions for Claude

When using this skill:

1. **Identify the environment** - Cloud Foundry, Kyma, Kubernetes, or Other
2. **Choose appropriate tool** - SMCTL, BTP CLI, CF CLI, kubectl, or cockpit
3. **Use correct authentication** - OAuth2, X.509, or interactive
4. **Check rate limits** - Implement retry logic for bulk operations
5. **Verify async completion** - Poll status for provision/bind operations
6. **Reference templates** - Use provided templates for common operations
7. **Check reference files** - Detailed information in references/ directory

**For Cloud Foundry**: Use `cf` CLI or cockpit
**For Kubernetes**: Use ServiceInstance/ServiceBinding CRDs
**For Other environments**: Use SMCTL or BTP CLI
**For API access**: Retrieve OAuth2 token first

When troubleshooting:
- Check operation status for async operations
- Verify credentials and permissions
- Review rate limits if getting 429 errors
- Check prerequisites (entitlements, quotas, dependencies)

---

**License**: GPL-3.0
**Version**: 1.1.1
**Maintained by**: SAP Skills Maintainers
**Repository**: [https://github.com/secondsky/sap-skills](https://github.com/secondsky/sap-skills)


---

## Referenced Files

> The following files are referenced in this skill and included for context.

### references/kubernetes-operator.md

```markdown
# SAP BTP Service Operator for Kubernetes

The SAP BTP Service Operator enables Kubernetes clusters to consume SAP BTP services through native Kubernetes resources.

**GitHub Repository**: [https://github.com/SAP/sap-btp-service-operator](https://github.com/SAP/sap-btp-service-operator)

**Documentation**: [https://github.com/SAP-docs/sap-btp-service-manager/tree/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments](https://github.com/SAP-docs/sap-btp-service-manager/tree/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments)

---

## Table of Contents

1. [Prerequisites](#prerequisites)
   - [Infrastructure & Tools](#infrastructure--tools)
   - [Environment Setup](#environment-setup)
   - [SAP BTP Requirements](#sap-btp-requirements)
2. [Setup Process](#setup-process)
   - [Install cert-manager](#step-1-install-cert-manager)
   - [Create Service Manager Credentials](#step-2-create-service-manager-credentials)
   - [Extract Credentials](#step-3-extract-credentials)
   - [Deploy Operator with Helm](#step-4-deploy-operator-with-helm)
3. [Custom Resource Definitions](#custom-resource-definitions)
   - [ServiceInstance CRD](#serviceinstance-crd)
   - [ServiceBinding CRD](#servicebinding-crd)
4. [Using Credentials in Pods](#using-credentials-in-pods)
   - [Environment Variables](#environment-variables)
   - [Volume Mount](#volume-mount)
5. [Migration from Service Catalog (svcat)](#migration-from-service-catalog-svcat)
   - [Prerequisites](#prerequisites-1)
   - [Step 1: Prepare Platform](#step-1-prepare-platform)
   - [Step 2: Install Migration CLI](#step-2-install-migration-cli)
   - [Step 3: Dry Run Migration](#step-3-dry-run-migration)
   - [Step 4: Execute Migration](#step-4-execute-migration)
   - [Migration Process](#migration-process)
   - [Important Notes](#important-notes)
6. [Troubleshooting](#troubleshooting)
   - [Operator Not Starting](#operator-not-starting)
   - [Instance Creation Fails](#instance-creation-fails)
   - [Binding Creation Fails](#binding-creation-fails)
   - [Secret Not Created](#secret-not-created)
7. [Best Practices](#best-practices)
8. [Documentation Links](#documentation-links)

---

## Prerequisites

### Infrastructure & Tools

| Requirement | Version | Purpose |
|-------------|---------|---------|
| Kubernetes cluster | - | Target deployment |
| kubectl | 1.7+ | Cluster management |
| Helm | 3.1.2+ | Operator deployment |
| SMCTL | 1.10.1+ | Service Manager CLI |

### Environment Setup

```bash
# Configure kubeconfig
export KUBECONFIG='/path/to/kubeconfig.yaml'

# Verify kubectl
kubectl version --client

# Verify Helm
helm version
```

### SAP BTP Requirements

- Active SAP Service Manager subscription
- Subaccount Service Administrator role
- Access to SAP BTP cockpit or SMCTL

---

## Setup Process

### Step 1: Install cert-manager

cert-manager handles TLS certificates for operator communication.

```bash
# Install cert-manager
kubectl apply -f [https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml](https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml)

# Verify installation
kubectl get pods -n cert-manager
```

Wait for all cert-manager pods to be Running.

---

### Step 2: Create Service Manager Credentials

**Option A: Using SMCTL**

```bash
# Login to Service Manager
smctl login -a [https://service-manager.cfapps.<region>.hana.ondemand.com](https://service-manager.cfapps.<region>.hana.ondemand.com) \
  --param subdomain=<subdomain>

# Create instance with service-operator-access plan
smctl provision sm-operator service-manager service-operator-access --mode sync

# Create binding
smctl bind sm-operator sm-operator-binding --mode sync

# Get credentials
smctl get-binding sm-operator-binding -o json
```

**Option B: Using BTP Cockpit**

1. Navigate to Services > Service Marketplace
2. Find "Service Manager"
3. Create instance with plan "service-operator-access"
4. Create binding and download credentials

---

### Step 3: Extract Credentials

From the binding, extract:

**Default Credentials**:
- `clientid`
- `clientsecret`
- `sm_url`
- `url` (UAA URL)

**X.509 Credentials** (if configured):
- `clientid`
- `certificate`
- `key`
- `certurl`
- `sm_url`

---

### Step 4: Deploy Operator with Helm

**Using Default Credentials**:

```bash
# Add Helm repository
helm repo add sap-btp-operator [https://sap.github.io/sap-btp-service-operator/](https://sap.github.io/sap-btp-service-operator/)
helm repo update

# Install operator
helm install sap-btp-operator sap-btp-operator/sap-btp-operator \
  --namespace sap-btp-operator \
  --create-namespace \
  --set manager.secret.clientid=<clientid> \
  --set manager.secret.clientsecret=<clientsecret> \
  --set manager.secret.sm_url=<sm_url> \
  --set manager.secret.tokenurl=<url>/oauth/token
```

**Using X.509 Credentials**:

```bash
helm install sap-btp-operator sap-btp-operator/sap-btp-operator \
  --namespace sap-btp-operator \
  --create-namespace \
  --set manager.secret.clientid=<clientid> \
  --set manager.secret.tls.crt="$(cat cert.pem)" \
  --set manager.secret.tls.key="$(cat key.pem)" \
  --set manager.secret.sm_url=<sm_url> \
  --set manager.secret.tokenurl=<certurl>/oauth/token
```

**Verify Installation**:

```bash
kubectl get pods -n sap-btp-operator
kubectl get crds | grep services.cloud.sap.com
```

---

## Custom Resource Definitions

### ServiceInstance CRD

**apiVersion**: `services.cloud.sap.com/v1alpha1`
**kind**: `ServiceInstance`

**Full Specification**:

```yaml
apiVersion: services.cloud.sap.com/v1alpha1
kind: ServiceInstance
metadata:
  name: my-service-instance
  namespace: default
  labels:
    app: my-app
spec:
  # Required: Service offering name from marketplace
  serviceOfferingName: xsuaa

  # Required: Service plan name
  servicePlanName: application

  # Optional: External name (appears in BTP cockpit)
  externalName: my-instance-external-name

  # Optional: Service-specific parameters
  parameters:
    xsappname: my-app
    tenant-mode: dedicated
    scopes:
      - name: read
        description: Read access
    role-templates:
      - name: Viewer
        scope-references:
          - read

  # Optional: Reference to secret containing parameters
  parametersFrom:
    - secretKeyRef:
        name: my-params-secret
        key: parameters

  # Optional: Custom tags
  customTags:
    - environment:production
    - team:platform
```

**Create Instance**:

```bash
kubectl apply -f service-instance.yaml
```

**Check Status**:

```bash
kubectl get serviceinstances
kubectl describe serviceinstance my-service-instance
```

**Status Conditions**:
- `Ready`: Instance is ready for use
- `Failed`: Provisioning failed

---

### ServiceBinding CRD

**apiVersion**: `services.cloud.sap.com/v1alpha1`
**kind**: `ServiceBinding`

**Full Specification**:

```yaml
apiVersion: services.cloud.sap.com/v1alpha1
kind: ServiceBinding
metadata:
  name: my-binding
  namespace: default
spec:
  # Required: Reference to ServiceInstance
  serviceInstanceName: my-service-instance

  # Optional: External name
  externalName: my-binding-external

  # Optional: Binding parameters
  parameters:
    credential-type: x509
    key-length: 4096
    validity-type: MONTHS
    validity: 6

  # Optional: Reference to secret containing parameters
  parametersFrom:
    - secretKeyRef:
        name: binding-params
        key: parameters

  # Optional: Name of secret to create (defaults to binding name)
  secretName: my-binding-secret

  # Optional: Secret template for custom formatting
  secretKey: credentials.json

  # Optional: Root key in secret
  secretRootKey: credentials
```

**Create Binding**:

```bash
kubectl apply -f service-binding.yaml
```

**Check Status**:

```bash
kubectl get servicebindings
kubectl describe servicebinding my-binding
```

**Access Credentials**:

```bash
# Credentials stored in Kubernetes secret
kubectl get secret my-binding -o yaml

# Decode credentials
kubectl get secret my-binding -o jsonpath='{.data.clientid}' | base64 -d
kubectl get secret my-binding -o jsonpath='{.data.clientsecret}' | base64 -d
```

---

## Using Credentials in Pods

### Environment Variables

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: my-app
spec:
  containers:
    - name: app
      image: my-app:latest
      env:
        - name: XSUAA_CLIENTID
          valueFrom:
            secretKeyRef:
              name: my-binding
              key: clientid
        - name: XSUAA_CLIENTSECRET
          valueFrom:
            secretKeyRef:
              name: my-binding
              key: clientsecret
        - name: XSUAA_URL
          valueFrom:
            secretKeyRef:
              name: my-binding
              key: url
```

### Volume Mount

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: my-app
spec:
  containers:
    - name: app
      image: my-app:latest
      volumeMounts:
        - name: credentials
          mountPath: /etc/secrets
          readOnly: true
  volumes:
    - name: credentials
      secret:
        secretName: my-binding
```

---

## Migration from Service Catalog (svcat)

### Prerequisites

- SMCTL CLI installed
- Service Catalog (svcat) currently deployed
- Access to both svcat and SAP BTP Service Operator

### Step 1: Prepare Platform

```bash
# Get cluster ID from catalog ConfigMap
CLUSTER_ID=$(kubectl get configmap cluster-info -n catalog -o jsonpath='{.data.id}')

# Prepare platform for migration
smctl curl -X PATCH "/v1/platforms/<platformID>" \
  -d '{"credentials":{"rotatable":true}}' \
  --param subaccount_id=<subaccount-id>
```

### Step 2: Install Migration CLI

```bash
# From GitHub releases
# [https://github.com/SAP/sap-btp-service-operator/releases](https://github.com/SAP/sap-btp-service-operator/releases)

# Or via Go
go install github.com/SAP/sap-btp-service-operator/tools/btpmigrate@latest
```

### Step 3: Dry Run Migration

```bash
# Test migration without making changes
btpmigrate --dry-run
```

Review any errors before proceeding.

### Step 4: Execute Migration

```bash
# Perform actual migration
btpmigrate
```

### Migration Process

1. **Scanning**: Fetches all instances/bindings from svcat and BTP
2. **Validation**: Verifies each resource can be migrated
3. **Migration**: Removes from svcat, adds to BTP operator

### Important Notes

- Platform becomes suspended during migration
- Reversible until actual migration starts
- Original svcat platform unusable after migration
- Test in non-production first

---

## Troubleshooting

### Operator Not Starting

```bash
# Check operator pods
kubectl get pods -n sap-btp-operator

# Check operator logs
kubectl logs -n sap-btp-operator deployment/sap-btp-operator-controller-manager

# Verify cert-manager
kubectl get pods -n cert-manager
```

### Instance Creation Fails

```bash
# Check instance status
kubectl describe serviceinstance <name>

# Look for events
kubectl get events --field-selector involvedObject.name=<instance-name>
```

**Common Issues**:
- Service not entitled in subaccount
- Invalid parameters
- Plan not available in region
- Quota exceeded

### Binding Creation Fails

```bash
# Check binding status
kubectl describe servicebinding <name>

# Verify instance is ready
kubectl get serviceinstance <instance-name>
```

**Common Issues**:
- Referenced instance not ready
- Instance doesn't support bindings
- Invalid binding parameters

### Secret Not Created

```bash
# Check binding status
kubectl get servicebinding <name> -o yaml

# Verify secret exists
kubectl get secrets | grep <binding-name>
```

---

## Best Practices

1. **Namespace Organization**: Group related services in namespaces
2. **Labels**: Use labels for filtering and organization
3. **External Names**: Use descriptive external names for cockpit visibility
4. **Parameters in Secrets**: Store sensitive parameters in Kubernetes secrets
5. **Resource Limits**: Set appropriate limits on operator deployment
6. **Monitoring**: Monitor operator health and CRD status
7. **Backup**: Document all ServiceInstance/ServiceBinding manifests

---

## Documentation Links

- **Setup**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments/setup-e977f23.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments/setup-e977f23.md)
- **Prerequisites**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments/prerequisites-dd5faaa.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments/prerequisites-dd5faaa.md)
- **Working with Operator**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments/working-with-sap-btp-service-operator-0ccebd7.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments/working-with-sap-btp-service-operator-0ccebd7.md)
- **Migration**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments/migrating-from-svcat-to-sap-btp-service-ec7f5c7.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/Consuming-SAP-BTP-Services-from-Various-Environments/migrating-from-svcat-to-sap-btp-service-ec7f5c7.md)
- **GitHub Repository**: [https://github.com/SAP/sap-btp-service-operator](https://github.com/SAP/sap-btp-service-operator)

```

### references/rate-limiting-filtering.md

```markdown
# Rate Limiting and Filtering Reference

Complete reference for SAP Service Manager API rate limits and query filtering.

**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. [Rate Limiting](#rate-limiting)
   - [Identification](#identification)
   - [Level 1: All APIs Combined](#level-1-all-apis-combined)
   - [Level 2: Resource-Specific Limits](#level-2-resource-specific-limits)
   - [Level 3: Instance Operations](#level-3-instance-operations)
   - [HTTP 429 Responses](#http-429-responses)
2. [Query Filtering](#query-filtering)
   - [Field Filtering](#field-filtering)
   - [Label Filtering](#label-filtering)
   - [Operators](#operators)
   - [Combining Filters](#combining-filters)
3. [Best Practices](#best-practices)
   - [Rate Limit Handling](#rate-limit-handling)
   - [Filter Optimization](#filter-optimization)
4. [Examples](#examples)
   - [Common Query Patterns](#common-query-patterns)
   - [Rate Limit Scenarios](#rate-limit-scenarios)

---

## Rate Limiting

SAP Service Manager implements **three concurrent rate limiting levels**. Exceeding any tier triggers throttling, even if other allowances remain.

### Identification

Callers identified by:
- Username (for user tokens)
- OAuth Client ID (for client tokens)

### Level 1: All APIs Combined

| Limit Type | Value |
|------------|-------|
| Per Hour | 10,000 requests |
| Per Minute | 1,000 requests |

Applies to all API endpoints combined.

---

### Level 2: Resource-Specific Limits

| Endpoint | Per Hour | Per Minute |
|----------|----------|------------|
| `/v1/service_bindings` | 6,000 | 600 |
| `/v1/service_offerings` | 1,000 | 100 |
| `/v1/service_plans` | 1,000 | 100 |

---

### Level 3: Method-Specific Limits

| Operation | Endpoint | Per Hour | Per Minute |
|-----------|----------|----------|------------|
| CREATE | `/v1/service_instances` | - | 50 |
| UPDATE | `/v1/service_instances` | 6,000 | 600 |
| DELETE | `/v1/service_instances` | 6,000 | 600 |

**Note**: CREATE has a stricter minute limit (50/min) to prevent provisioning storms.

---

### Rate Limit Error Response

**HTTP Status**: `429 Too Many Requests`

**Response Headers**:
| Header | Description |
|--------|-------------|
| `Retry-After` | When to retry (HTTP-date format) |

**HTTP-date Format**: `Sun, 06 Nov 1994 08:49:37 GMT`

**Example Response**:
```json
{
  "error": "rate_limit_exceeded",
  "description": "Request rate limit exceeded. Please retry after the time specified in the Retry-After header."
}
```

---

### Best Practices for Rate Limits

1. **Implement Exponential Backoff**:
```javascript
async function withRetry(fn, maxRetries = 5) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      return await fn();
    } catch (error) {
      if (error.status === 429) {
        const retryAfter = error.headers['retry-after'];
        const waitTime = retryAfter ?
          new Date(retryAfter) - Date.now() :
          Math.pow(2, i) * 1000;
        await sleep(waitTime);
      } else {
        throw error;
      }
    }
  }
}
```

2. **Batch Operations**: Group related operations where possible

3. **Cache Responses**: Cache listing responses (offerings, plans)

4. **Stagger Requests**: Distribute requests over time

5. **Monitor Usage**: Track request counts to stay within limits

---

## Filtering

The SAP Service Manager APIs support filtering via query parameters on GET (list) endpoints.

### Query Parameter Types

| Parameter | Purpose | Example |
|-----------|---------|---------|
| `fieldQuery` | Filter by field values | `type eq 'kubernetes'` |
| `labelQuery` | Filter by label values | `environment eq 'dev'` |

Both can be combined; results must match both criteria.

---

### Supported Literal Types

| Type | Format | Example |
|------|--------|---------|
| String | Single quotes | `'my-value'` |
| Boolean | Unquoted | `true`, `false` |
| Integer | Digits with optional sign | `42`, `-7`, `+100` |
| Date-time | ISO 8601 | `2025-01-15T10:30:00Z` |

**String Escaping**: Double single quotes for embedded quotes (`'it''s valid'`)

---

### Field Query Operators

#### Universal Operators (Field & Label Queries)

| Operator | Description | Example |
|----------|-------------|---------|
| `eq` | Equal | `name eq 'my-instance'` |
| `en` | Equal or null | `broker_id en 'abc-123'` |
| `ne` | Not equal | `type ne 'kubernetes'` |
| `in` | In list | `plan_name in ('small','medium')` |
| `notin` | Not in list | `status notin ('failed','pending')` |
| `and` | Logical AND | `type eq 'cf' and ready eq true` |
| `contains` | Substring match | `name contains 'prod'` |

#### Field-Only Operators

| Operator | Description | Example |
|----------|-------------|---------|
| `gt` | Greater than | `created_at gt '2025-01-01T00:00:00Z'` |
| `ge` | Greater than or equal | `version ge 2` |
| `lt` | Less than | `updated_at lt '2025-06-01T00:00:00Z'` |
| `le` | Less than or equal | `retries le 3` |

---

### Filterable Resources

| Resource | Supports fieldQuery | Supports labelQuery |
|----------|---------------------|---------------------|
| Platforms | Yes | Yes |
| Service Brokers | Yes | Yes |
| Service Instances | Yes | Yes |
| Service Bindings | Yes | Yes |
| Service Plans | Yes | No |
| Service Offerings | Yes | No |

---

### Common Field Names

#### Service Instances
| Field | Type | Description |
|-------|------|-------------|
| `id` | String | Instance ID |
| `name` | String | Instance name |
| `service_plan_id` | String | Plan ID |
| `platform_id` | String | Platform ID |
| `ready` | Boolean | Readiness status |
| `usable` | Boolean | Usability status |
| `created_at` | DateTime | Creation timestamp |
| `updated_at` | DateTime | Last update timestamp |

#### Service Bindings
| Field | Type | Description |
|-------|------|-------------|
| `id` | String | Binding ID |
| `name` | String | Binding name |
| `service_instance_id` | String | Associated instance |
| `ready` | Boolean | Readiness status |
| `created_at` | DateTime | Creation timestamp |

#### Platforms
| Field | Type | Description |
|-------|------|-------------|
| `id` | String | Platform ID |
| `name` | String | Platform name |
| `type` | String | Platform type |

---

### Query Examples

#### Single Field Filter

```
GET /v1/service_instances?fieldQuery=ready eq true
```

#### Multiple Conditions (AND)

```
GET /v1/service_instances?fieldQuery=ready eq true and usable eq true
```

#### In List

```
GET /v1/service_instances?fieldQuery=service_plan_id in ('plan-1','plan-2','plan-3')
```

#### Date Range

```
GET /v1/service_instances?fieldQuery=created_at gt '2025-01-01T00:00:00Z' and created_at lt '2025-02-01T00:00:00Z'
```

#### String Contains

```
GET /v1/service_instances?fieldQuery=name contains 'production'
```

#### Label Query

```
GET /v1/service_instances?labelQuery=environment eq 'production'
```

#### Combined Field and Label Query

```
GET /v1/service_instances?fieldQuery=ready eq true&labelQuery=team eq 'platform'
```

#### Complex Query

```
GET /v1/service_instances?fieldQuery=broker_id eq 'abc-123' and plan_name in ('small','medium') and ready eq true&labelQuery=environment eq 'dev'
```

---

### URL Encoding

Special characters must be URL-encoded:

| Character | Encoded |
|-----------|---------|
| Space | `%20` or `+` |
| Single quote | `%27` |
| Comma | `%2C` |
| Colon | `%3A` |

**Example**:
```
# Original
fieldQuery=name eq 'my instance'

# Encoded
fieldQuery=name%20eq%20%27my%20instance%27
```

---

### Pagination

List endpoints support pagination:

| Parameter | Description |
|-----------|-------------|
| `max_items` | Maximum results per page |
| `token` | Continuation token |

**Response**:
```json
{
  "items": [...],
  "num_items": 50,
  "token": "next-page-token"
}
```

**Usage**:
```
GET /v1/service_instances?max_items=50
GET /v1/service_instances?max_items=50&token=<token-from-previous>
```

---

### Syntax Rules

1. **String literals** require single quotes
2. **Boolean literals** must not be quoted
3. **Literals cannot use brackets** (except in `in`/`notin` lists)
4. **Embedded quotes** use double single quotes (`''`)
5. **Whitespace** around operators is optional but recommended
6. **Case sensitivity**: Field names are case-sensitive

---

### Error Handling

**Invalid Query Syntax**:
```json
{
  "error": "InvalidQuery",
  "description": "Invalid fieldQuery syntax at position 15"
}
```

**Unknown Field**:
```json
{
  "error": "InvalidField",
  "description": "Field 'invalid_field' is not supported for filtering"
}
```

---

## Documentation Links

- **Rate Limiting**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/rate-limiting-97be679.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/rate-limiting-97be679.md)
- **Filtering**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/filtering-parameters-and-operators-3331c6e.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/filtering-parameters-and-operators-3331c6e.md)

```

### references/smctl-commands.md

```markdown
# SMCTL Command Reference

Service Manager Control (SMCTL) is the CLI for SAP Service Manager.

**Installation**: [https://github.com/Peripli/service-manager-cli/releases/latest](https://github.com/Peripli/service-manager-cli/releases/latest)

**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. [Global Flags](#global-flags)
2. [Authentication Commands](#authentication-commands)
   - [smctl login](#smctl-login)
   - [smctl logout](#smctl-logout)
3. [Service Instance Commands](#service-instance-commands)
   - [smctl provision](#smctl-provision)
   - [smctl deprovision](#smctl-deprovision)
   - [smctl list-instances](#smctl-list-instances)
   - [smctl get-instance](#smctl-get-instance)
   - [smctl update-instance](#smctl-update-instance)
4. [Service Binding Commands](#service-binding-commands)
   - [smctl bind](#smctl-bind)
   - [smctl unbind](#smctl-unbind)
   - [smctl list-bindings](#smctl-list-bindings)
   - [smctl get-binding](#smctl-get-binding)
5. [Service Broker Commands](#service-broker-commands)
   - [smctl register-broker](#smctl-register-broker)
   - [smctl update-broker](#smctl-update-broker)
   - [smctl list-brokers](#smctl-list-brokers)
   - [smctl delete-broker](#smctl-delete-broker)
6. [Platform Commands](#platform-commands)
   - [smctl register-platform](#smctl-register-platform)
   - [smctl update-platform](#smctl-update-platform)
   - [smctl list-platforms](#smctl-list-platforms)
   - [smctl delete-platform](#smctl-delete-platform)
7. [Marketplace Commands](#marketplace-commands)
   - [smctl marketplace](#smctl-marketplace)
8. [Operations Commands](#operations-commands)
   - [smctl status](#smctl-status)
   - [smctl list-operations](#smctl-list-operations)
9. [Common Examples](#common-examples)
10. [Tips and Best Practices](#tips-and-best-practices)

---

## Global Flags

Available on all commands:

| Flag | Description |
|------|-------------|
| `--config <path>` | Path to config.json (default: `$HOME/.sm/config.json`) |
| `-v, --verbose` | Enable verbose output |
| `-h, --help` | Display help |

---

## Authentication Commands

### smctl login

Authenticate to SAP Service Manager.

**Syntax**:
```bash
smctl login [flags]
```

**Aliases**: `login`, `l`

**Required Flags**:
| Flag | Description |
|------|-------------|
| `-a, --url <url>` | Base URL for SAP Service Manager |
| `--param subdomain=<value>` | Subaccount subdomain (required) |

**Optional Flags**:
| Flag | Description |
|------|-------------|
| `-u, --user <user>` | User ID |
| `-p, --password <pass>` | Password |
| `--auth-flow <flow>` | `password` (default) or `client-credentials` |
| `--client-id <id>` | Client ID for client-credentials flow |
| `--client-secret <secret>` | Client secret |
| `--cert <path>` | Path to certificate file (X.509) |
| `--key <path>` | Path to private key file (X.509) |
| `--skip-ssl-validation` | Skip SSL verification (not recommended) |

**Examples**:
```bash
# Interactive password login
smctl login -a [https://service-manager.cfapps.eu10.hana.ondemand.com](https://service-manager.cfapps.eu10.hana.ondemand.com) \
  --param subdomain=my-subaccount

# Client credentials (default)
smctl login -a [https://service-manager.cfapps.eu10.hana.ondemand.com](https://service-manager.cfapps.eu10.hana.ondemand.com) \
  --param subdomain=my-subaccount \
  --auth-flow client-credentials \
  --client-id abc123 \
  --client-secret xyz789

# Client credentials (X.509)
smctl login -a [https://service-manager.cfapps.eu10.hana.ondemand.com](https://service-manager.cfapps.eu10.hana.ondemand.com) \
  --param subdomain=my-subaccount \
  --auth-flow client-credentials \
  --client-id abc123 \
  --cert /path/to/cert.pem \
  --key /path/to/key.pem
```

**2FA Note**: If 2FA enabled, append passcode to password (e.g., `Password1234` + `5678` = `Password12345678`)

**Session**: Expires after 30 minutes of inactivity.

---

### smctl logout

End current session.

**Syntax**:
```bash
smctl logout
```

---

## Instance Commands

### smctl provision

Create a service instance.

**Syntax**:
```bash
smctl provision [name] [offering] [plan] [flags]
```

**Arguments**:
| Argument | Description |
|----------|-------------|
| `name` | Instance name |
| `offering` | Service offering name |
| `plan` | Service plan name |

**Flags**:
| Flag | Description |
|------|-------------|
| `-b, --broker-name <name>` | Broker name (if offering name conflicts) |
| `--mode <mode>` | `sync` or `async` (default: async) |
| `-c, --parameters <json>` | JSON configuration parameters |
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Examples**:
```bash
# Basic provisioning (async)
smctl provision my-instance xsuaa application

# Sync mode
smctl provision my-instance xsuaa application --mode sync

# With parameters
smctl provision my-instance hana hdi-shared \
  -c '{"database_id":"abc-123"}'

# JSON output
smctl provision my-instance xsuaa application -o json
```

---

### smctl deprovision

Delete a service instance.

**Syntax**:
```bash
smctl deprovision [name] [flags]
```

**Flags**:
| Flag | Description |
|------|-------------|
| `-f, --force` | Delete without confirmation |
| `-id <id>` | Instance ID (if name not unique) |
| `--mode <mode>` | `sync` or `async` (default: async) |

**Examples**:
```bash
# Interactive deletion
smctl deprovision my-instance

# Force delete (no confirmation)
smctl deprovision my-instance -f

# Sync mode
smctl deprovision my-instance --mode sync -f
```

---

### smctl list-instances

List all service instances.

**Syntax**:
```bash
smctl list-instances [flags]
```

**Aliases**: `list-instances`, `li`

**Flags**:
| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Output columns**: ID, Name, Service Plan, Platform, Created, Updated, Ready, Usable, Labels

---

### smctl get-instance

Get details of a specific instance.

**Syntax**:
```bash
smctl get-instance [name] [flags]
```

**Aliases**: `get-instance`, `gi`

**Flags**:
| Flag | Description |
|------|-------------|
| `-id <id>` | Instance ID (if name not unique) |
| `--show-instance-params` | Show service instance configuration parameters |
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Examples**:
```bash
# Basic retrieval
smctl get-instance sample-instance

# With configuration parameters
smctl get-instance sample-instance --show-instance-params

# JSON output
smctl get-instance sample-instance -o json
```

**Output**: ID, Name, Service Plan ID, Platform ID, Created, Updated, Ready, Usable, Labels, Last Operation

---

## Binding Commands

### smctl bind

Create a service binding.

**Syntax**:
```bash
smctl bind [instance-name] [binding-name] [flags]
```

**Flags**:
| Flag | Description |
|------|-------------|
| `--mode <mode>` | `sync` or `async` (default: async) |
| `-c, --parameters <json>` | JSON configuration |
| `-id <id>` | Instance ID (if name not unique) |
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Examples**:
```bash
# Basic binding
smctl bind my-instance my-binding

# With X.509 credentials
smctl bind my-instance my-binding -c '{"credential-type":"x509"}'

# X.509 with custom validity
smctl bind my-instance my-binding -c '{
  "credential-type": "x509",
  "key-length": 4096,
  "validity-type": "MONTHS",
  "validity": 6
}'

# Sync mode
smctl bind my-instance my-binding --mode sync
```

**X.509 Parameters**:
| Parameter | Default | Description |
|-----------|---------|-------------|
| `credential-type` | - | Set to `x509` for certificate auth |
| `key-length` | 2048 | Private key length in bytes |
| `validity-type` | DAYS | `DAYS`, `MONTHS`, or `YEARS` |
| `validity` | 7 | Number of validity units |

---

### smctl unbind

Delete a service binding.

**Syntax**:
```bash
smctl unbind [instance-name] [binding-name] [flags]
```

**Flags**:
| Flag | Description |
|------|-------------|
| `-f, --force` | Delete without confirmation |
| `--mode <mode>` | `sync` or `async` (default: async) |
| `-id <id>` | Binding ID (if name not unique) |

---

### smctl list-bindings

List all service bindings.

**Syntax**:
```bash
smctl list-bindings [flags]
```

**Aliases**: `list-bindings`, `lsb`

**Flags**:
| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `json`, `yaml`, or `text` |

---

### smctl get-binding

Get details of a specific binding (includes credentials).

**Syntax**:
```bash
smctl get-binding [name] [flags]
```

**Aliases**: `get-binding`, `gsb`

**Flags**:
| Flag | Description |
|------|-------------|
| `-id <id>` | Binding ID (if name not unique) |
| `--show-binding-params` | Show service binding configuration parameters |
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Examples**:
```bash
# Basic retrieval
smctl get-binding sample-binding

# With binding parameters
smctl get-binding sample-binding --show-binding-params

# JSON output
smctl get-binding sample-binding -o json
```

**Output**: ID, Name, Instance Name, Credentials, Created, Updated, Ready, Labels, Last Operation

---

## Broker Commands

### smctl register-broker

Register a service broker.

**Syntax**:
```bash
smctl register-broker [name] [url] <description> [flags]
```

**Aliases**: `register-broker`, `rb`

**Required Flags**:
| Flag | Description |
|------|-------------|
| `-b, --basic <user:pass>` | Basic auth credentials |

**Optional Flags**:
| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Example**:
```bash
smctl register-broker my-broker [https://broker.example.com](https://broker.example.com) "My broker" \
  -b admin:password123
```

---

### smctl update-broker

Update a registered broker.

**Syntax**:
```bash
smctl update-broker [name] <json_broker> [flags]
```

**Aliases**: `update-broker`, `ub`

**Flags**:
| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Example**:
```bash
smctl update-broker broker '{"name": "new-name", "description": "new-description", "broker_url": "[http://broker.com",](http://broker.com",) "credentials": { "basic": { "username": "admin", "password": "admin" }}}'
```

---

### smctl list-brokers

List all registered brokers.

**Syntax**:
```bash
smctl list-brokers [flags]
```

**Aliases**: `list-brokers`, `lb`

**Flags**:
| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Output columns**: ID, Name, URL, Description, Created, Updated

---

### smctl delete-broker

Delete one or more registered brokers.

**Syntax**:
```bash
smctl delete-broker [name] <name2> <name3> ... [flags]
```

**Aliases**: `delete-broker`, `db`

**Flags**:
| Flag | Description |
|------|-------------|
| `-f, --force` | Delete without confirmation |

**Example**:
```bash
smctl delete-broker sample-broker-1
# Output: Broker with name: sample-broker-1 successfully deleted
```

---

## Platform Commands

### smctl register-platform

Register a platform.

**Syntax**:
```bash
smctl register-platform [name] [type] <description> [flags]
```

**Aliases**: `register-platform`, `rp`

**Flags**:
| Flag | Description |
|------|-------------|
| `-i, --id <id>` | Custom platform ID (auto-generated if omitted) |
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Example**:
```bash
smctl register-platform my-k8s-cluster kubernetes "Production K8s cluster"
```

---

### smctl update-platform

Update a registered platform.

**Syntax**:
```bash
smctl update-platform [name] <json_platform> [flags]
```

**Aliases**: `update-platform`, `up`

**Flags**:
| Flag | Description |
|------|-------------|
| `--regenerate-credentials` | Generate new credentials (old credentials become invalid) |
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Example**:
```bash
smctl update-platform platform '{"name": "new-name", "description": "new-description", "type": "new-type"}'
```

**Note**: When using `--regenerate-credentials`, old credentials can no longer be used.

---

### smctl list-platforms

List all registered platforms.

**Syntax**:
```bash
smctl list-platforms [flags]
```

**Aliases**: `list-platforms`, `lp`

**Flags**:
| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Output columns**: ID, Name, Type, Description, Created, Updated

---

### smctl delete-platform

Delete one or more platforms.

**Syntax**:
```bash
smctl delete-platform <name1> <name2> ... <nameN> [flags]
```

**Aliases**: `delete-platform`, `dp`

**Flags**:
| Flag | Description |
|------|-------------|
| `-f, --force` | Delete without confirmation |
| `--cascade-delete` | Delete asynchronously with cascade (returns operation URL) |
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Examples**:
```bash
# Standard deletion
smctl delete-platform sample-platform
# Output: Platform with name: sample-platform successfully deleted

# Cascade delete (async)
smctl delete-platform sample-platform --cascade-delete
# Returns: smctl status /v1/platforms/{id}/operations/{operation-id}
```

**Note**: Cascade delete schedules an async operation; use `smctl status` to monitor.

---

## Marketplace Commands

### smctl marketplace

List available service offerings and plans.

**Syntax**:
```bash
smctl marketplace [flags]
```

**Aliases**: `marketplace`, `m`

**Flags**:
| Flag | Description |
|------|-------------|
| `-s, --service <name>` | Show plans for specific service |
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Examples**:
```bash
# List all offerings
smctl marketplace

# List plans for specific service
smctl marketplace -s xsuaa
```

---

### smctl list-offerings

List all service offerings associated with the Service Manager.

**Syntax**:
```bash
smctl list-offerings [flags]
```

**Aliases**: `list-offerings`, `lo`

**Flags**:
| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Example**:
```bash
smctl list-offerings
smctl lo -o json
```

**Output columns**: ID, Name, Description, Broker ID, Ready, Labels

---

### smctl list-plans

List all service plans associated with the Service Manager.

**Syntax**:
```bash
smctl list-plans [flags]
```

**Flags**:
| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Example**:
```bash
smctl list-plans
smctl list-plans -o json
```

**Output columns**: ID, Name, Description, Offering ID, Ready, Labels

---

## Status Commands

### smctl status

Check async operation status.

**Syntax**:
```bash
smctl status <operation-url>
```

**Example**:
```bash
# After async provision
smctl status /v1/service_instances/abc-123/operations/op-456
```

---

## Other Commands

### smctl help

Display help for any command.

**Syntax**:
```bash
smctl help [command]
smctl [command] --help
```

### smctl info

Display information about the connected SAP Service Manager instance.

**Syntax**:
```bash
smctl info [flags]
```

**Aliases**: `info`, `i`

**Flags**:
| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `json`, `yaml`, or `text` |

**Output**: Service Management URL and authenticated user account.

---

### smctl version

Display SMCTL version information.

**Syntax**:
```bash
smctl version [flags]
```

**Aliases**: `version`, `v`

**Example**:
```bash
smctl version
# Output: Service Management Client 0.0.1
```

---

## Documentation Links

- **Installation**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/installing-the-service-manager-control-smctl-command-line-tool-93532bd.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/installing-the-service-manager-control-smctl-command-line-tool-93532bd.md)
- **Login**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/login-a8ed7cf.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/login-a8ed7cf.md)
- **Provision**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/provision-b327b66.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/provision-b327b66.md)
- **Bind**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/bind-f53ff26.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/bind-f53ff26.md)
- **Get Instance**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/get-instance-24fb85c.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/get-instance-24fb85c.md)
- **Get Binding**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/get-binding-8495036.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/get-binding-8495036.md)
- **List Offerings**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/list-offerings-8a0659f.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/list-offerings-8a0659f.md)
- **List Plans**: [https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/list-plans-b0e4863.md](https://github.com/SAP-docs/sap-btp-service-manager/blob/main/docs/Service-Consumption/SAP-Service-Manager/list-plans-b0e4863.md)
- **GitHub Releases**: [https://github.com/Peripli/service-manager-cli/releases](https://github.com/Peripli/service-manager-cli/releases)

```

sap-btp-service-manager | SkillHub