IBM CephaaS Object Storage API

Introduction With the IBM® Storage Ceph® as a Service Object Storage API, you can programmatically manage object storage resources within an IBM Storage Ceph as a Service deployment, including Object Access Keys and S3 Ingress Certificates. For more information, see About IBM Storage Ceph as a Service APIshttps://cloud.ibm.com/docs/cephaas?topic=cephaas-about-api. SDKs SDK for Go is available for this API. The client libraries that are provided by the SDK implement best practices for using the API and reduce the amount of code that you need to write. The tab for each language includes code examples that demonstrate how to use the client libraries. For more details about using IBM Storage Ceph as a Service, see docshttps://cloud.ibm.com/docs/cephaas?topic=cephaas-getting-started. Installing the Go SDK Go modules recommended: Add the following import in your code, and then run go build or go mod tidy go import "github.com/IBM/sds-go-sdk/sdsaasv1" Go get bash go get -u github.com/IBM/sds-go-sdk/sdsaasv1 View on GitHub https://github.com/IBM/sds-go-sdkhttps://github.com/IBM/sds-go-sdk Endpoint URLs IBM Storage Ceph as a Service Object Storage API is available in all IBM CephaaS deployments. To get the endpoint URL that you can use for a deployment, contact your Storage Administrator. Authentication The IBM Storage Ceph as a Service Object Storage API uses Identity and Access Management IAM to authenticate requests. To call each API method, you must be assigned a role that has access to the parent service instance. Check your access on the IBM Cloud console by navigating to Users User Access. Learn about obtaining an IAM token for an authenticated user or service ID in the IAM Identity Services APIhttps://cloud.ibm.com/apidocs/iam-identity-token-api. If you first create an API keyhttps://cloud.ibm.com/docs/account?topic=account-userapikey&interface=apicreateuserkey-api, you can use it to generate an IAM tokenhttps://cloud.ibm.com/docs/account?topic=account-iamtokenfromapikey. To use the API, add a valid IAM token to the HTTP Authorization request header. For example, -H 'Authorization: Bearer {token}'. When you use the SDK, configure an IAM authenticator with the IAM API key. The authenticator automatically obtains the IAM access token for the API key and includes it with each request. You can construct an authenticator in either of two ways: - Programmatically by constructing an IAM authenticator instance and supplying your IAM API key. - By defining the API key in external configuration properties, and then by using the SDK authenticator factory to construct an IAM authenticator that uses the configured IAM API key. In this example of using external configuration properties, an IAM authenticator instance is created with the configured API key, and then the service client is constructed with this authenticator instance and the configured service URL. For more information, see the Authentication section of the IBM Cloud SDK Commonhttps://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md documentation. To call each method, you need to be assigned a role that includes the required IAM actions. Each method lists the associated action. For more information about IAM actions and how they map to roles, see Assigning access to account management serviceshttps://cloud.ibm.com/docs/account?topic=account-account-services. To retrieve your access token: bash curl -X POST \ "https://iam.cloud.ibm.com/identity/token" \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Accept: application/json' \ --data-urlencode 'granttype=urn:ibm:params:oauth:grant-type:apikey' \ --data-urlencode 'apikey={APIKEY}' Replace {APIKEY} with your IAM API keyhttps://cloud.ibm.com/docs/account?topic=account-userapikey. Setting client options through external configuration Example environment variables, where {SERVICEURL} is the endpoint URL and {APIKEY} is your IAM API key sh export GLOBALSEARCHURL={SERVICEURL} export GLOBALSEARCHAUTHTYPE=iam export GLOBALSEARCHAPIKEY={APIKEY} Example of constructing the service client go import { "github.com/IBM/sds-go-sdk/sdsaasv1" } ... authenticator := &core.IamAuthenticator{ ApiKey:

MethodPathSummary
GET/s3_credentialsList HMAC credentials
DELETE/s3_credentials/{access_key}Delete HMAC credentials
POST/s3_credentials/{access_key}Create HMAC credentials
GET/certificatesList the configured certificates
DELETE/certificates/{cert_type}Delete SSL certificate
GET/certificates/{cert_type}Get SSL cert status
POST/certificates/{cert_type}Create SSL certificates
PUT/certificates/{cert_type}Replace an SSL certificate