IBM CephaaS Block Storage Management API | IBM Cloud API Docs

Introduction

With the IBM® Storage Ceph® as a Service Block Storage API, you can programmatically provision and manage block storage resources within a IBM Storage Ceph as a Service deployment, including volumes, hosts, and volume to host mappings. For more information, see About IBM Storage Ceph as a Service APIs.

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 docs.

Installing the Go SDK

Go modules (recommended): Add the following import in your code, and then run go build or go mod tidy

import (
	"github.com/IBM/sds-go-sdk/sdsaasv1"
)

Go get

go get -u github.com/IBM/sds-go-sdk/sdsaasv1

View on GitHub

Endpoint URLs

IBM Storage Ceph as a Service Block Storage API is available in all IBM Storage Ceph as a Service 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 Block 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 API.

If you first create an API key, you can use it to generate an IAM token.

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 Common documentation.

IAM action information

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 services.

To retrieve your access token:

curl -X POST   "https://iam.cloud.ibm.com/identity/token"   --header 'Content-Type: application/x-www-form-urlencoded'   --header 'Accept: application/json'   --data-urlencode 'grant_type=urn:ibm:params:oauth:grant-type:apikey'   --data-urlencode 'apikey={API_KEY}'

Replace {API_KEY} with your IAM API key.

Setting client options through external configuration

Example environment variables, where {SERVICE_URL} is the endpoint URL and {API_KEY} is your IAM API key

export GLOBAL_SEARCH_URL={SERVICE_URL}
export GLOBAL_SEARCH_AUTHTYPE=iam
export GLOBAL_SEARCH_APIKEY={API_KEY}

Example of constructing the service client

import {
    "github.com/IBM/sds-go-sdk/sdsaasv1"
}
...
authenticator := &core.IamAuthenticator{
		ApiKey: <apiKey>,
	}

sdsaasServiceOptions := &sdsaasv1.SdsaasV1Options{
		URL:           <serviceEndpoint>,
		Authenticator: authenticator,
	}

sdsaasService, err = sdsaasv1.NewSdsaasV1(sdsaasServiceOptions)
	if err != nil {
		panic(err)
	}

Auditing

You can monitor API activity within your account. Whenever an API method is called, an event is generated which you can then track and audit. The specific event type is listed for each method that generates auditing events. For methods that don't list any events, no events are generated.

For more information about how to track IBM Storage Ceph as a Service activity, see Auditing the events for IBM Storage Ceph as a Service.

Error handling

This API uses standard HTTP response codes to indicate whether a method was completed successfully. A 200 response indicates success. A 400 type response indicates a failure, and a 500 type response indicates an internal system error.

Table 1. Error codes
HTTP Error Code Description Recovery
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.
401 Unauthorized You are not authorized to make this request. If this error persists, contact the account owner to check your permissions.
403 Forbidden The supplied authentication is not authorized to perform the requested operation. You do not have valid access through IAM access policies. If this error persists, contact the account owner to check your permissions.
404 Not Found The requested resource could not be found.
405 Method Not Allowed The requested resource does not support the request method.
406 Not Acceptable The resource the client had requested is not available in a format that is allowed by the Accept header that is supplied by the client.
408 Request timeout The connection to the server timed out. Wait a few minutes, then try again.
409 Conflict The request cannot be completed because of a conflict between the request and the current state of the resource.
500 Internal Server Error The request cannot be processed because the client encountered an unexpected condition on the server. Wait a few minutes and try submitting the request again. If this error persists, contact IBM Support.
501 Not Implemented The server either does not recognize the request method, or it lacks the ability to fulfill the request.
502 Bad Gateway The server was acting as a gateway or proxy and received an invalid response from the upstream server.
503 Service Unavailable The server cannot process the request. Generally, this condition is temporary, such as when a server is overloaded or down for scheduled maintenance. This condition could also be due to an unplanned outage of a service that is needed to process the request. Wait a few minutes and try submitting the request again. If this error persists, contact IBM Support.
504 Gateway timeout The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
505 HTTP Version Not Supported The server does not support the HTTP protocol version that is used in the request.

Versioning

Requests to the IBM CephaaS Block Storage API require a major version as the first segment of the request path (/v1/).

Methods

List all Volumes

This request lists volumes in the deployment. Volumes are network-connected block storage devices that may be mapped to one or more hosts in the same deployment.

This request lists volumes in the deployment. Volumes are network-connected block storage devices that may be mapped to one or more hosts in the same deployment.

GET /volumes
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) ListVolumes(listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error)

Request

Instantiate the ListVolumesOptions struct and set the fields to provide parameter values for the ListVolumes method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Query Parameters

  • A server-provided token determining what resource to start the page on

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

  • The number of resources to return on a page

    Possible values: 1 ≤ value ≤ 1000

    Default: 1000

    Example: 20

  • Filters the collection of resources with a name property matching the exact specified name

    Possible values: 1 ≤ length ≤ 63, Value must match regular expression ^[a-z][a-z0-9]*(-[a-z0-9]+)*$

    Example: my-resource

WithContext method only

The ListVolumes options.

  • curl -X GET --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/volumes?start=r134-b274-678d-4dfb-8981-c71dd9d4daa5&limit=20&name=my-resource"
  • listVolumesOptions := &ibmstoragecephasaserviceblockstorageapiv1.ListVolumesOptions{
      IBMAPIVersion: CreateMockDate("2025-02-01"),
      Limit: core.Int64Ptr(int64(20)),
      Name: core.StringPtr("my-resource"),
    }
    
    pager, err := ibmStorageCephAsAServiceBlockStorageApiService.NewVolumesPager(listVolumesOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []ibmstoragecephasaserviceblockstorageapiv1.Volume
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))

Response

A page of volumes

A page of volumes.

Status Code

  • The volumes were retrieved successfully

No Sample Response

This method does not specify any sample responses.

Create a Volume

This request creates a new volume from a volume prototype object. The prototype object is structured in the same way as a retrieved volume, and contains the information necessary to create the new volume.

This request creates a new volume from a volume prototype object. The prototype object is structured in the same way as a retrieved volume, and contains the information necessary to create the new volume.

POST /volumes
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) CreateVolume(createVolumeOptions *CreateVolumeOptions) (result *VolumeSummary, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) CreateVolumeWithContext(ctx context.Context, createVolumeOptions *CreateVolumeOptions) (result *VolumeSummary, response *core.DetailedResponse, err error)

Request

Instantiate the CreateVolumeOptions struct and set the fields to provide parameter values for the CreateVolume method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Volume Template

Examples:
{
  "name": "my-volume"
}

WithContext method only

The CreateVolume options.

  • curl -X POST --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   --header 'Content-Type: application/json'   --data '{ "capacity": 1 }'   "${base_url}/volumes"
  • createVolumeOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewCreateVolumeOptions(
      CreateMockDate("2025-02-01"),
      int64(1),
    )
    
    volumeSummary, response, err := ibmStorageCephAsAServiceBlockStorageApiService.CreateVolume(createVolumeOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(volumeSummary, "", "  ")
    fmt.Println(string(b))

Response

The volume object

The volume object.

Status Code

  • Volume creation request has been accepted

  • An invalid volume object was provided

Example responses
  • {
      "capacity": 30
    }
  • {
      "capacity": 30
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Delete a volume

This request deletes a volume. This operation cannot be reversed. For this request to succeed, the volume must not be mapped to any hosts.

This request deletes a volume. This operation cannot be reversed. For this request to succeed, the volume must not be mapped to any hosts.

DELETE /volumes/{id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteVolume(deleteVolumeOptions *DeleteVolumeOptions) (response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteVolumeWithContext(ctx context.Context, deleteVolumeOptions *DeleteVolumeOptions) (response *core.DetailedResponse, err error)

Request

Instantiate the DeleteVolumeOptions struct and set the fields to provide parameter values for the DeleteVolume method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The volume identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The DeleteVolume options.

  • curl -X DELETE --location --header "Authorization: Bearer IAM_TOKEN"   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/volumes/ID"
  • deleteVolumeOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewDeleteVolumeOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
    )
    
    response, err := ibmStorageCephAsAServiceBlockStorageApiService.DeleteVolume(deleteVolumeOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteVolume(): %d\n", response.StatusCode)
    }

Response

Status Code

  • The volume was deleted successfully

  • Volume with specified id not found

  • Volume cannot be deleted as it is mapped to one or more hosts

Example responses
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Retrieve a volume

This request retrieves a single volume specified by the identifier in the URL

This request retrieves a single volume specified by the identifier in the URL.

GET /volumes/{id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) GetVolume(getVolumeOptions *GetVolumeOptions) (result *Volume, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) GetVolumeWithContext(ctx context.Context, getVolumeOptions *GetVolumeOptions) (result *Volume, response *core.DetailedResponse, err error)

Request

Instantiate the GetVolumeOptions struct and set the fields to provide parameter values for the GetVolume method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The volume identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The GetVolume options.

  • curl -X GET --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/volumes/ID"
  • getVolumeOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewGetVolumeOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
    )
    
    volume, response, err := ibmStorageCephAsAServiceBlockStorageApiService.GetVolume(getVolumeOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(volume, "", "  ")
    fmt.Println(string(b))

Response

The volume object

The volume object.

Status Code

  • The volume was retrieved successfully

  • A volume with the specified identifier could not be found

Example responses
  • {
      "capacity": 30,
      "snapshot_count": 5
    }
  • {
      "capacity": 30,
      "snapshot_count": 5
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Update a volume

This request updates a volume with the information in a provided volume patch. The volume patch object is structured in the same way as a retrieved volume and contains only the information to be updated.

This request updates a volume with the information in a provided volume patch. The volume patch object is structured in the same way as a retrieved volume and contains only the information to be updated.

PATCH /volumes/{id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) UpdateVolume(updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error)

Request

Instantiate the UpdateVolumeOptions struct and set the fields to provide parameter values for the UpdateVolume method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The volume identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

Volume patch request body

Examples:
{
  "capacity": 100,
  "name": "my-volume"
}

WithContext method only

The UpdateVolume options.

  • curl -X PATCH --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   --header 'Content-Type: application/merge-patch+json'   --data ''   "${base_url}/volumes/ID"
  • volumePatchModel := &ibmstoragecephasaserviceblockstorageapiv1.VolumePatch{
    }
    volumePatchModelAsPatch, asPatchErr := volumePatchModel.AsPatch()
    Expect(asPatchErr).To(BeNil())
    
    updateVolumeOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewUpdateVolumeOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
      volumePatchModelAsPatch,
    )
    
    volume, response, err := ibmStorageCephAsAServiceBlockStorageApiService.UpdateVolume(updateVolumeOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(volume, "", "  ")
    fmt.Println(string(b))

Response

The volume object

The volume object.

Status Code

  • The volume update request was accepted

  • An invalid volume patch was provided

  • A volume with the specified identifier could not be found

Example responses
  • {
      "capacity": 30,
      "snapshot_count": 5
    }
  • {
      "capacity": 30,
      "snapshot_count": 5
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

List all hosts

This request lists all hosts in the deployment. Hosts are objects representing the NVMe initiators that may be mapped to one or more volumes in the same deployment.

This request lists all hosts in the deployment. Hosts are objects representing the NVMe initiators that may be mapped to one or more volumes in the same deployment.

GET /hosts
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) ListHosts(listHostsOptions *ListHostsOptions) (result *HostCollection, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) ListHostsWithContext(ctx context.Context, listHostsOptions *ListHostsOptions) (result *HostCollection, response *core.DetailedResponse, err error)

Request

Instantiate the ListHostsOptions struct and set the fields to provide parameter values for the ListHosts method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Query Parameters

  • A server-provided token determining what resource to start the page on

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

  • The number of resources to return on a page

    Possible values: 1 ≤ value ≤ 1000

    Default: 1000

    Example: 20

  • Filters the collection to resources with a name property matching the exact specified name

    Possible values: 1 ≤ length ≤ 63, Value must match regular expression ^[a-z][a-z0-9]*(-[a-z0-9]+)*$

    Example: my-resource

WithContext method only

The ListHosts options.

  • curl -X GET --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/hosts?start=r134-b274-678d-4dfb-8981-c71dd9d4daa5&limit=20&name=my-resource"
  • listHostsOptions := &ibmstoragecephasaserviceblockstorageapiv1.ListHostsOptions{
      IBMAPIVersion: CreateMockDate("2025-02-01"),
      Limit: core.Int64Ptr(int64(20)),
      Name: core.StringPtr("my-resource"),
    }
    
    pager, err := ibmStorageCephAsAServiceBlockStorageApiService.NewHostsPager(listHostsOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []ibmstoragecephasaserviceblockstorageapiv1.Host
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))

Response

Collection of host objects

Collection of host objects.

Status Code

  • The Hosts were retrieved successfully

No Sample Response

This method does not specify any sample responses.

Create a host

This request creates a new host from a host prototype object. The prototype object contains the information necessary to provision the new host which can also be mapped to one or more volumes.

This request creates a new host from a host prototype object. The prototype object contains the information necessary to provision the new host which can also be mapped to one or more volumes.

POST /hosts
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) CreateHost(createHostOptions *CreateHostOptions) (result *HostSummary, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) CreateHostWithContext(ctx context.Context, createHostOptions *CreateHostOptions) (result *HostSummary, response *core.DetailedResponse, err error)

Request

Instantiate the CreateHostOptions struct and set the fields to provide parameter values for the CreateHost method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Create host request body

Examples:
{
  "name": "my-host",
  "nqn": "nqn.2014-06.org:1234",
  "psk": "NVMeTLSkey-1:01:5CBxDU8ejK+PrqIjTau0yDHnBV2CdfvP6hGmqnPdKhJ9tfi2:"
}

WithContext method only

The CreateHost options.

  • curl -X POST --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   --header 'Content-Type: application/json'   --data '{ "name": "my-host", "nqn": "nqn.2014-06.org:1234" }'   "${base_url}/hosts"
  • createHostOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewCreateHostOptions(
      CreateMockDate("2025-02-01"),
      "my-host",
      "nqn.2014-06.org:1234",
    )
    
    hostSummary, response, err := ibmStorageCephAsAServiceBlockStorageApiService.CreateHost(createHostOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(hostSummary, "", "  ")
    fmt.Println(string(b))

Response

Host creation response

Host creation response.

Status Code

  • Host creation request has been accepted

  • An invalid host object was provided

Example responses
  • {
      "nqn": "nqn.2014-06.org:1234",
      "psk_enabled": true
    }
  • {
      "nqn": "nqn.2014-06.org:1234",
      "psk_enabled": true
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Delete a Host

This request deletes a host. For this request to succeed, the host must not be mapped to any volumes.

This request deletes a host. For this request to succeed, the host must not be mapped to any volumes.

DELETE /hosts/{id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteHost(deleteHostOptions *DeleteHostOptions) (response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteHostWithContext(ctx context.Context, deleteHostOptions *DeleteHostOptions) (response *core.DetailedResponse, err error)

Request

Instantiate the DeleteHostOptions struct and set the fields to provide parameter values for the DeleteHost method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The Host identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The DeleteHost options.

  • curl -X DELETE --location --header "Authorization: Bearer IAM_TOKEN"   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/hosts/ID"
  • deleteHostOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewDeleteHostOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
    )
    
    response, err := ibmStorageCephAsAServiceBlockStorageApiService.DeleteHost(deleteHostOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteHost(): %d\n", response.StatusCode)
    }

Response

Status Code

  • The host deletion request has been accepted

  • Host with specified id not found

  • Host cannot be deleted as it is mapped to one or more Volumes

Example responses
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Retrieve a Host

This request retrieves a host specified by the identifier in the URL

This request retrieves a host specified by the identifier in the URL.

GET /hosts/{id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) GetHost(getHostOptions *GetHostOptions) (result *Host, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) GetHostWithContext(ctx context.Context, getHostOptions *GetHostOptions) (result *Host, response *core.DetailedResponse, err error)

Request

Instantiate the GetHostOptions struct and set the fields to provide parameter values for the GetHost method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The Host identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The GetHost options.

  • curl -X GET --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/hosts/ID"
  • getHostOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewGetHostOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
    )
    
    host, response, err := ibmStorageCephAsAServiceBlockStorageApiService.GetHost(getHostOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(host, "", "  ")
    fmt.Println(string(b))

Response

Host Schema

Host Schema.

Status Code

  • The host was retrieved successfully

  • A host with the specified identifier could not be found

Example responses
  • {
      "nqn": "nqn.2014-06.org:1234",
      "psk_enabled": true
    }
  • {
      "nqn": "nqn.2014-06.org:1234",
      "psk_enabled": true
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Update a given Host

This request updates a Host with the information in a provided host patch object. The host patch object is structured in the same way as a retrieved host and contains only the information to be updated.

This request updates a Host with the information in a provided host patch object. The host patch object is structured in the same way as a retrieved host and contains only the information to be updated.

PATCH /hosts/{id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) UpdateHost(updateHostOptions *UpdateHostOptions) (result *Host, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) UpdateHostWithContext(ctx context.Context, updateHostOptions *UpdateHostOptions) (result *Host, response *core.DetailedResponse, err error)

Request

Instantiate the UpdateHostOptions struct and set the fields to provide parameter values for the UpdateHost method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The Host identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

Host Patch body

WithContext method only

The UpdateHost options.

  • curl -X PATCH --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   --header 'Content-Type: application/merge-patch+json'   --data ''   "${base_url}/hosts/ID"
  • hostPatchModel := &ibmstoragecephasaserviceblockstorageapiv1.HostPatch{
    }
    hostPatchModelAsPatch, asPatchErr := hostPatchModel.AsPatch()
    Expect(asPatchErr).To(BeNil())
    
    updateHostOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewUpdateHostOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
      hostPatchModelAsPatch,
    )
    
    host, response, err := ibmStorageCephAsAServiceBlockStorageApiService.UpdateHost(updateHostOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(host, "", "  ")
    fmt.Println(string(b))

Response

Host Schema

Host Schema.

Status Code

  • The Host was updated successfully

  • An invalid Host patch was provided

  • A Host with the specified identifier could not be found

Example responses
  • {
      "nqn": "nqn.2014-06.org:1234",
      "psk_enabled": true
    }
  • {
      "nqn": "nqn.2014-06.org:1234",
      "psk_enabled": true
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Deletes all the volume mappings for a given host

This request deletes all volume mappings for a host

This request deletes all volume mappings for a host.

DELETE /hosts/{id}/volume_mappings
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteHostMappings(deleteHostMappingsOptions *DeleteHostMappingsOptions) (response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteHostMappingsWithContext(ctx context.Context, deleteHostMappingsOptions *DeleteHostMappingsOptions) (response *core.DetailedResponse, err error)

Request

Instantiate the DeleteHostMappingsOptions struct and set the fields to provide parameter values for the DeleteHostMappings method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The Host identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The DeleteHostMappings options.

  • curl -X DELETE --location --header "Authorization: Bearer IAM_TOKEN"   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/hosts/ID/volume_mappings"
  • deleteHostMappingsOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewDeleteHostMappingsOptions(
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
      CreateMockDate("2025-02-01"),
    )
    
    response, err := ibmStorageCephAsAServiceBlockStorageApiService.DeleteHostMappings(deleteHostMappingsOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteHostMappings(): %d\n", response.StatusCode)
    }

Response

Status Code

  • The deletion request was accepted

  • The specified host ID could not be found

Example responses
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

List all volume mappings for a host

This request lists volume mappings for a host.

This request lists volume mappings for a host.

GET /hosts/{id}/volume_mappings
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) ListVolumeMappings(listVolumeMappingsOptions *ListVolumeMappingsOptions) (result *VolumeMappingCollection, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) ListVolumeMappingsWithContext(ctx context.Context, listVolumeMappingsOptions *ListVolumeMappingsOptions) (result *VolumeMappingCollection, response *core.DetailedResponse, err error)

Request

Instantiate the ListVolumeMappingsOptions struct and set the fields to provide parameter values for the ListVolumeMappings method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The Host identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

Query Parameters

  • A server-provided token determining what resource to start the page on

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

  • The number of resources to return on a page

    Possible values: 1 ≤ value ≤ 1000

    Default: 1000

    Example: 20

  • Filters the collection of resources with a name property matching the exact specified name

    Possible values: 1 ≤ length ≤ 63, Value must match regular expression ^[a-z][a-z0-9]*(-[a-z0-9]+)*$

    Example: my-resource

WithContext method only

The ListVolumeMappings options.

  • curl -X GET --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/hosts/ID/volume_mappings?start=r134-b274-678d-4dfb-8981-c71dd9d4daa5&limit=20&name=my-resource"
  • listVolumeMappingsOptions := &ibmstoragecephasaserviceblockstorageapiv1.ListVolumeMappingsOptions{
      ID: core.StringPtr("r134-b274-678d-4dfb-8981-c71dd9d4daa5"),
      IBMAPIVersion: CreateMockDate("2025-02-01"),
      Limit: core.Int64Ptr(int64(20)),
      Name: core.StringPtr("my-resource"),
    }
    
    pager, err := ibmStorageCephAsAServiceBlockStorageApiService.NewVolumeMappingsPager(listVolumeMappingsOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []ibmstoragecephasaserviceblockstorageapiv1.VolumeMapping
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))

Response

Collection of volume mappings for a host

Collection of volume mappings for a host.

Status Code

  • The volume mappings were retrieved successfully

No Sample Response

This method does not specify any sample responses.

Create a Volume mapping for a host

This request creates a new volume mapping for a given host.

This request creates a new volume mapping for a given host.

POST /hosts/{id}/volume_mappings
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) CreateVolumeMapping(createVolumeMappingOptions *CreateVolumeMappingOptions) (result *VolumeMappingReference, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) CreateVolumeMappingWithContext(ctx context.Context, createVolumeMappingOptions *CreateVolumeMappingOptions) (result *VolumeMappingReference, response *core.DetailedResponse, err error)

Request

Instantiate the CreateVolumeMappingOptions struct and set the fields to provide parameter values for the CreateVolumeMapping method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The Host identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

Volume mapping request

WithContext method only

The CreateVolumeMapping options.

  • curl -X POST --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   --header 'Content-Type: application/json'   --data '{ "volume": { "id": "r134-b274-678d-4dfb-8981-c71dd9d4daa5" } }'   "${base_url}/hosts/ID/volume_mappings"
  • volumeIdentityModel := &ibmstoragecephasaserviceblockstorageapiv1.VolumeIdentity{
      ID: core.StringPtr("r134-b274-678d-4dfb-8981-c71dd9d4daa5"),
    }
    
    createVolumeMappingOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewCreateVolumeMappingOptions(
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
      CreateMockDate("2025-02-01"),
      volumeIdentityModel,
    )
    
    volumeMappingReference, response, err := ibmStorageCephAsAServiceBlockStorageApiService.CreateVolumeMapping(createVolumeMappingOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(volumeMappingReference, "", "  ")
    fmt.Println(string(b))

Response

Schema for a volume mapping to a host in pending state

Schema for a volume mapping to a host in pending state.

Status Code

  • Volume mapping request has been accepted. This is an asynchronous operation and its progress can be monitored using the "status".

  • An invalid volume mapping object was provided

Example responses
  • {
      "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5-1a6b7274-678d-4dfb-8981-c71dd9d4da45"
    }
  • {
      "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5-1a6b7274-678d-4dfb-8981-c71dd9d4da45"
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Deletes the volume mapping

This request deletes the volume mapping

This request deletes the volume mapping.

DELETE /hosts/{id}/volume_mappings/{volume_mapping_id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteHostMapping(deleteHostMappingOptions *DeleteHostMappingOptions) (response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteHostMappingWithContext(ctx context.Context, deleteHostMappingOptions *DeleteHostMappingOptions) (response *core.DetailedResponse, err error)

Request

Instantiate the DeleteHostMappingOptions struct and set the fields to provide parameter values for the DeleteHostMapping method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The host identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

  • The Volume mapping identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The DeleteHostMapping options.

  • curl -X DELETE --location --header "Authorization: Bearer IAM_TOKEN"   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/hosts/ID/volume_mappings/${volume_mapping_id}"
  • deleteHostMappingOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewDeleteHostMappingOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
    )
    
    response, err := ibmStorageCephAsAServiceBlockStorageApiService.DeleteHostMapping(deleteHostMappingOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteHostMapping(): %d\n", response.StatusCode)
    }

Response

Status Code

  • The deletion request was accepted

  • The volume mapping or host with the specified identifier could not be found

Example responses
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Retrieve a volume mapping

This request retrieves a single volume mapping specified by the identifier in the URL

This request retrieves a single volume mapping specified by the identifier in the URL.

GET /hosts/{id}/volume_mappings/{volume_mapping_id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) GetVolumeMapping(getVolumeMappingOptions *GetVolumeMappingOptions) (result *VolumeMapping, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) GetVolumeMappingWithContext(ctx context.Context, getVolumeMappingOptions *GetVolumeMappingOptions) (result *VolumeMapping, response *core.DetailedResponse, err error)

Request

Instantiate the GetVolumeMappingOptions struct and set the fields to provide parameter values for the GetVolumeMapping method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The host identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

  • The volume mapping identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The GetVolumeMapping options.

  • curl -X GET --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/hosts/ID/volume_mappings/${volume_mapping_id}"
  • getVolumeMappingOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewGetVolumeMappingOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
    )
    
    volumeMapping, response, err := ibmStorageCephAsAServiceBlockStorageApiService.GetVolumeMapping(getVolumeMappingOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(volumeMapping, "", "  ")
    fmt.Println(string(b))

Response

Volume mapping object depicting the mapping between a volume and a host

Volume mapping object depicting the mapping between a volume and a host.

Status Code

  • The volume mapping was retrieved successfully

  • A volume mapping with the specified identifier could not be found

Example responses
  • {
      "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5-1a6b7274-678d-4dfb-8981-c71dd9d4da45",
      "subsystem_nqn": "nqn.2014-06.org:1234"
    }
  • {
      "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5-1a6b7274-678d-4dfb-8981-c71dd9d4da45",
      "subsystem_nqn": "nqn.2014-06.org:1234"
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }
  • {
      "trace": "659f5fa6-98bc-4f3f-a3ff-8c953223c6c1",
      "status_code": 400,
      "errors": [
        {
          "code": "user_credential_invalid",
          "more_info": "https://cloud.ibm.com/docs/cephaas#user_credential_invalid",
          "message": "The user lacks valid authentication credential for the target resource",
          "target": {
            "name": "nqn",
            "type": "field",
            "value": "value"
          }
        }
      ]
    }

Delete a filtered collection of snapshots

This request deletes snapshots that match the specified filter.

This request deletes snapshots that match the specified filter.

DELETE /snapshots
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteSnapshots(deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteSnapshotsWithContext(ctx context.Context, deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error)

Request

Instantiate the DeleteSnapshotsOptions struct and set the fields to provide parameter values for the DeleteSnapshots method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Query Parameters

  • Filters the collection to resources with a source_volume.id property matching the specified identifier.

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

  • Filters the collection to resources with a source_volume_group.id property matching the specified identifier.

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The DeleteSnapshots options.

  • curl -X DELETE --location --header "Authorization: Bearer IAM_TOKEN"   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/snapshots?source_volume.id=r134-b274-678d-4dfb-8981-c71dd9d4daa5&source_volume_group.id=r134-b274-678d-4dfb-8981-c71dd9d4daa5"
  • deleteSnapshotsOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewDeleteSnapshotsOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
    )
    
    response, err := ibmStorageCephAsAServiceBlockStorageApiService.DeleteSnapshots(deleteSnapshotsOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteSnapshots(): %d\n", response.StatusCode)
    }

Response

Status Code

  • The snapshots were deleted successfully.

  • An invalid query parameter or header was provided.

No Sample Response

This method does not specify any sample responses.

List all Snapshots

This request lists snapshots in the deployment. A snapshot preserves the data of a volume at the time the snapshot is created.

This request lists snapshots in the deployment. A snapshot preserves the data of a volume at the time the snapshot is created.

GET /snapshots
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) ListSnapshots(listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error)

Request

Instantiate the ListSnapshotsOptions struct and set the fields to provide parameter values for the ListSnapshots method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Query Parameters

  • A server-provided token determining what resource to start the page on

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

  • The number of resources to return on a page

    Possible values: 1 ≤ value ≤ 1000

    Default: 1000

    Example: 20

  • Filters the collection of resources with a name property matching the exact specified name

    Possible values: 1 ≤ length ≤ 63, Value must match regular expression ^[a-z][a-z0-9]*(-[a-z0-9]+)*$

    Example: my-resource

  • Filters the collection to resources with a source_volume.id property matching the specified identifier.

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

  • Filters the collection to resources with a source_volume_group.id property matching the specified identifier.

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The ListSnapshots options.

  • curl -X GET --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/snapshots?start=r134-b274-678d-4dfb-8981-c71dd9d4daa5&limit=20&name=my-resource&source_volume.id=r134-b274-678d-4dfb-8981-c71dd9d4daa5&source_volume_group.id=r134-b274-678d-4dfb-8981-c71dd9d4daa5"
  • listSnapshotsOptions := &ibmstoragecephasaserviceblockstorageapiv1.ListSnapshotsOptions{
      IBMAPIVersion: CreateMockDate("2025-02-01"),
      Limit: core.Int64Ptr(int64(20)),
      Name: core.StringPtr("my-resource"),
      SourceVolumeID: core.StringPtr("r134-b274-678d-4dfb-8981-c71dd9d4daa5"),
      SourceVolumeGroupID: core.StringPtr("r134-b274-678d-4dfb-8981-c71dd9d4daa5"),
    }
    
    pager, err := ibmStorageCephAsAServiceBlockStorageApiService.NewSnapshotsPager(listSnapshotsOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []ibmstoragecephasaserviceblockstorageapiv1.Snapshot
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))

Response

A page of snapshots

A page of snapshots.

Status Code

  • The snapshots were retrieved successfully

No Sample Response

This method does not specify any sample responses.

Create a Snapshot

This request creates a new snapshot from a snapshot prototype object. The prototype object is structured in the same way as a retrieved snapshot, and contains the information necessary to provision the new snapshot.
Note: After snapshot creation, the inital size is reported as 1 GiB by default.

This request creates a new snapshot from a snapshot prototype object. The prototype object is structured in the same way as a retrieved snapshot, and contains the information necessary to provision the new snapshot.
Note: After snapshot creation, the inital size is reported as 1 GiB by default.

POST /snapshots
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) CreateSnapshot(createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error)

Request

Instantiate the CreateSnapshotOptions struct and set the fields to provide parameter values for the CreateSnapshot method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Snapshot Template

Examples:
{
  "name": "my-snapshot"
}

WithContext method only

The CreateSnapshot options.

  • curl -X POST --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   --header 'Content-Type: application/json'   --data '{ "source_volume": { "id": "r134-b274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-resource", "resource_type": "testString" } }'   "${base_url}/snapshots"
  • sourceVolumeModel := &ibmstoragecephasaserviceblockstorageapiv1.SourceVolume{
      ID: core.StringPtr("r134-b274-678d-4dfb-8981-c71dd9d4daa5"),
      Name: core.StringPtr("my-resource"),
      ResourceType: core.StringPtr("testString"),
    }
    
    createSnapshotOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewCreateSnapshotOptions(
      CreateMockDate("2025-02-01"),
      sourceVolumeModel,
    )
    
    snapshot, response, err := ibmStorageCephAsAServiceBlockStorageApiService.CreateSnapshot(createSnapshotOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(snapshot, "", "  ")
    fmt.Println(string(b))

Response

The snapshot object

The snapshot object.

Status Code

  • Snapshot creation request has been accepted

  • An invalid snapshot prototype object was provided.

Example responses
  • {
      "lifecycle_state": "stable",
      "size": 30,
      "minimum_capacity": 30,
      "deletable": true
    }
  • {
      "lifecycle_state": "stable",
      "size": 30,
      "minimum_capacity": 30,
      "deletable": true
    }

Delete a snapshot

This request deletes a snapshot.

This request deletes a snapshot.

DELETE /snapshots/{id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteSnapshot(deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) DeleteSnapshotWithContext(ctx context.Context, deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error)

Request

Instantiate the DeleteSnapshotOptions struct and set the fields to provide parameter values for the DeleteSnapshot method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The snapshot identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The DeleteSnapshot options.

  • curl -X DELETE --location --header "Authorization: Bearer IAM_TOKEN"   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/snapshots/ID"
  • deleteSnapshotOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewDeleteSnapshotOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
    )
    
    response, err := ibmStorageCephAsAServiceBlockStorageApiService.DeleteSnapshot(deleteSnapshotOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteSnapshot(): %d\n", response.StatusCode)
    }

Response

Status Code

  • The snapshot was deleted successfully.

  • A snapshot with the specified identifier could not be found.

No Sample Response

This method does not specify any sample responses.

Retrieve a snapshot

This request retrieves a single snapshot specified by the identifier in the URL.

This request retrieves a single snapshot specified by the identifier in the URL.

GET /snapshots/{id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) GetSnapshot(getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error)

Request

Instantiate the GetSnapshotOptions struct and set the fields to provide parameter values for the GetSnapshot method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The snapshot identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

WithContext method only

The GetSnapshot options.

  • curl -X GET --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   "${base_url}/snapshots/ID"
  • getSnapshotOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewGetSnapshotOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
    )
    
    snapshot, response, err := ibmStorageCephAsAServiceBlockStorageApiService.GetSnapshot(getSnapshotOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(snapshot, "", "  ")
    fmt.Println(string(b))

Response

The snapshot object

The snapshot object.

Status Code

  • The snapshot was retrieved successfully

  • A snapshot with the specified identifier could not be found.

Example responses
  • {
      "lifecycle_state": "stable",
      "size": 30,
      "minimum_capacity": 30,
      "deletable": true
    }
  • {
      "lifecycle_state": "stable",
      "size": 30,
      "minimum_capacity": 30,
      "deletable": true
    }

Update a snapshot

This request updates a snapshot with the information in a provided snapshot patch.

This request updates a snapshot with the information in a provided snapshot patch.

PATCH /snapshots/{id}
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) UpdateSnapshot(updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error)
(ibmStorageCephAsAServiceBlockStorageApi *IbmStorageCephAsAServiceBlockStorageApiV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error)

Request

Instantiate the UpdateSnapshotOptions struct and set the fields to provide parameter values for the UpdateSnapshot method.

Custom Headers

  • The API version, in format YYYY-MM-DD. For the API behavior documented here, specify any date from 2025-02-01 to current date in UTC time zone.

    Possible values: length = 10, Value must match regular expression ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

    Example: 2025-02-01

Path Parameters

  • The snapshot identifier

    Possible values: 1 ≤ length ≤ 64, Value must match regular expression ^[-0-9a-z_]+$

    Example: r134-b274-678d-4dfb-8981-c71dd9d4daa5

The name for this snapshot. The name must not be used by another snapshot.

Examples:
{
  "name": "my-snapshot"
}

WithContext method only

The UpdateSnapshot options.

  • curl -X PATCH --location --header "Authorization: Bearer IAM_TOKEN"   --header 'Accept: application/json'   --header 'IBM-API-Version: "2025-02-01"'   --header 'Content-Type: application/merge-patch+json'   --data ''   "${base_url}/snapshots/ID"
  • snapshotPatchModel := &ibmstoragecephasaserviceblockstorageapiv1.SnapshotPatch{
    }
    snapshotPatchModelAsPatch, asPatchErr := snapshotPatchModel.AsPatch()
    Expect(asPatchErr).To(BeNil())
    
    updateSnapshotOptions := ibmStorageCephAsAServiceBlockStorageApiService.NewUpdateSnapshotOptions(
      CreateMockDate("2025-02-01"),
      "r134-b274-678d-4dfb-8981-c71dd9d4daa5",
      snapshotPatchModelAsPatch,
    )
    
    snapshot, response, err := ibmStorageCephAsAServiceBlockStorageApiService.UpdateSnapshot(updateSnapshotOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(snapshot, "", "  ")
    fmt.Println(string(b))

Response

The snapshot object

The snapshot object.

Status Code

  • The snapshot was updated successfully.

  • An invalid snapshot patch was provided.

  • A snapshot with the specified identifier could not be found.

Example responses
  • {
      "lifecycle_state": "stable",
      "size": 30,
      "minimum_capacity": 30,
      "deletable": true
    }
  • {
      "lifecycle_state": "stable",
      "size": 30,
      "minimum_capacity": 30,
      "deletable": true
    }
id=curlclassName=tab-item-selected