Skip to content
Last updated

HPE GreenLake for Object Storage Developer Guide

HPE GreenLake for Object Storage offers RESTful APIs for Object Storage, enabling management and configuration of buckets, users, and group and access policies.

Prerequisites


Endpoints

Endpoints are the host URLs that you submit your API requests to. Object Storage has unique endpoints in specific regions. Use the following list to identify your application endpoint.

Authentication

The Object Storage API uses an access token for authentication. Instructions for obtaining an access token can be found on the Authentication page.

The HTTP Authorization request header is used to provide the access token in all API requests as a Bearer token.

  • Authorization:Bearer <access token>

Authorization

All API requests are authorized using permissions. The user owning the access token must have the required permissions assigned for the resources being accessed in order to be authorized. The required permissions are documented in the following guide pages.

Required permissions

To use the HPE GreenLake Object Storage API, you need appropriate permissions based on your role:

  • object-storage.bucket.read for all GET and LIST requests on bucket resources
  • object-storage.bucket.create for all POST requests on bucket resources
  • object-storage.bucket.update for all PUT requests on bucket resources
  • object-storage.bucket.delete for all DELETE requests on bucket resources
  • object-storage.object-user.read for all GET and LIST requests for user resources
  • object-storage.object-user.create for all POST requests for user resources
  • object-storage.object-user.update for all PUT requests for user resources
  • object-storage.object-user.delete for all DELETE requests for user resources
  • object-storage.object-group.read for all GET and LIST requests for group resources
  • object-storage.object-group.create for all POST requests for group resources
  • object-storage.object-group.update for all PUT requests for group resources
  • object-storage.object-group.delete for all DELETE requests for group resources
  • object-storage.object-access-policy.read for all GET and LIST requests for access policy resources
  • object-storage.object-access-policy.create for all POST requests for access policy resources
  • object-storage.object-access-policy.update for all PUT requests for access policy resources
  • object-storage.object-access-policy.delete for all DELETE requests for access policy resources

For more information about roles and permissions, see the HPE GreenLake Cloud User Guide.

Features

The Object Storage APIs are broadly categorized into the following feature areas:

  • Create, list, update and delete object storage buckets
  • Configure bucket properties including versioning, object locking, and lifecycle policies
  • Report bucket capacity and performance
  • Manage bucket metadata
  • Manage bucket access control lists (ACLs)
  • Manage users and user groups

Making it all work


General guidelines

  • For asynchronous operations that return HTTP status 201 or 202, use the Location header in the API response to track progress.

  • Replace the base URL in examples with the endpoint for your region.

Create a new bucket

Create a bucket on an HPE Alletra Storage MP X10000 device. Provide name, optional bucketTags (array of key/value pairs), and compression (example: DISABLED). Replace {systemId} with your system identifier.

POST https://us-west.api.greenlake.hpe.com/object-storage/v1alpha1/devtype7-storage-systems/{systemId}/buckets

Payload:

{
  "name": "myBucketName",
  "compression": "DISABLED",
  "bucketTags": [
    {
      "key": "location",
      "value": ""
    }
  ],
  "versioning": "ENABLED",
  "objectLockConfiguration": {
    "objectLockEnabled": "ENABLED",
    "rule": {
      "defaultRetention": {
        "days": 1,
        "mode": "GOVERNANCE",
        "years": 1
      }
    }
  },
  "notificationService": "DISABLED",
  "notificationServiceConfiguration": {}
}

The endpoint https://us-west.api.greenlake.hpe.com is the endpoint for the US West application. If you are using HPE GreenLake for Object Storage in a different region, replace the endpoint with the endpoint the corresponding region.

Listing all buckets

Retrieve the list of buckets for the specified HPE Alletra Storage MP X10000 device. Replace {systemId} with your system identifier.

GET https://us-west.api.greenlake.hpe.com/object-storage/v1alpha1/devtype7-storage-systems/{systemId}/buckets

Delete a bucket

Delete the specified bucket on the given HPE Alletra Storage MP X10000 device. Replace {systemId} and {bucketId} with actual IDs.

DELETE https://us-west.api.greenlake.hpe.com/object-storage/v1alpha1/devtype7-storage-systems/{systemId}/buckets/{bucketId}

Create a new user

Create a user on an HPE Alletra Storage MP X10000 device. Provide the username in the payload. Replace {systemId} with your system identifier.

POST https://us-west.api.greenlake.hpe.com/object-storage/v1alpha1/devtype7-storage-systems/{systemId}/users

Payload:

{
  "name": "NewUser"
}

Listing all users

Retrieve the list of users for the specified HPE Alletra Storage MP X10000 device. Replace {systemId} with your system identifier.

GET https://us-west.api.greenlake.hpe.com/object-storage/v1alpha1/devtype7-storage-systems/{systemId}/users

Delete a user

Delete the specified user from the given HPE Alletra Storage MP X10000 device. Replace {systemId} and {userId} with actual IDs.

DELETE https://us-west.api.greenlake.hpe.com/object-storage/v1alpha1/devtype7-storage-systems/{systemId}/users/{userId}

Create a new group

Create a group on an HPE Alletra Storage MP X10000 device. Provide group name and optional users array (member names). Replace {systemId} with your system identifier.

POST https://us-west.api.greenlake.hpe.com/object-storage/v1alpha1/devtype7-storage-systems/{systemId}/groups

Payload:

{
  "name": "NewGroup1",
  "users": [
    "MyUser"
  ]
}

Listing all groups

Retrieve the list of groups for the specified HPE Alletra Storage MP X10000 device. Replace {systemId} with your system identifier.

GET https://us-west.api.greenlake.hpe.com/object-storage/v1alpha1/devtype7-storage-systems/{systemId}/groups

Delete a group

Delete the specified group on the given HPE Alletra Storage MP X10000 device. Replace {systemId} and {groupId} with actual IDs.

DELETE https://us-west.api.greenlake.hpe.com/object-storage/v1alpha1/devtype7-storage-systems/{systemId}/groups/{groupId}