Skip to content

Instantly share code, notes, and snippets.

@karatechops
Last active August 27, 2019 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karatechops/d8e7cf1e28a16007fb9da55a41663f2e to your computer and use it in GitHub Desktop.
Save karatechops/d8e7cf1e28a16007fb9da55a41663f2e to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.1",
"basePath": "/containers/v1",
"info": {
"title": "HPE Nimble Storage Container Storage Provider (CSP) REST API",
"description": "This API, used by the HPE CSI Driver for Kubernetes, enables management of resources used for\ncontainer workloads. It is not intended for direct usage outside of the CSI driver\nbut is provided here for documentation purposes.",
"contact": {
"name": "Hewlett Packard Enterprise"
},
"version": "1.0.0"
},
"tags": [
{
"name": "hosts",
"description": "A host represents a member of the container orchestrator cluster"
},
{
"name": "tokens",
"description": "A token is used to authenticate all connection to the CSP"
},
{
"name": "volumes",
"description": "Volumes are the storage devices created on the Nimble array"
},
{
"name": "snapshots",
"description": "Snapshots are point in time instances of volumes"
},
{
"name": "volume_groups",
"description": "Volume groups are groups of volumes that are protected together"
},
{
"name": "snapshot_groups",
"description": "Volume group snapshots are crash consistent snapshots created on the volume group"
}
],
"paths": {
"/hosts/{id}": {
"delete": {
"summary": "Delete host",
"operationId": "deleteHost",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "The id of the host to delete",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/hosts": {
"post": {
"summary": "Create host",
"operationId": "createHost",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "A host that needs to be added to the CSP",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Host"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Host"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/snapshots/{id}": {
"get": {
"summary": "Get a snapshot with the given ID",
"operationId": "getSnapshot",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "Snapshot ID",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContainerVolumeSnapshot"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if snapshot ID cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"delete": {
"summary": "Delete a snapshot",
"operationId": "deleteSnapshot",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "The id of the snapshot to delete",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not found if snapshot ID is not found"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/snapshots": {
"get": {
"summary": "Get all snapshots for the provided volume",
"operationId": "getSnapshots",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "volume_id",
"in": "query",
"description": "Volume ID",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "name",
"in": "query",
"description": "Snapshot name",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ContainerVolumeSnapshot"
}
}
}
}
},
"400": {
"description": "Bad Request if volume ID is not provided"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if volume ID or snapshot name cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"post": {
"summary": "Create a snapshot",
"operationId": "createSnapshot",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "A new snapshot that is to be created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContainerVolumeSnapshot"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContainerVolumeSnapshot"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/tokens/{id}": {
"delete": {
"summary": "Delete the access token",
"operationId": "delete",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "The id of the access token to delete",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/tokens": {
"post": {
"summary": "Create an access token",
"operationId": "createToken",
"requestBody": {
"description": "An access token to grant access to the CSP",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccessToken"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccessToken"
}
}
}
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/volume_groups": {
"get": {
"summary": "Get all volume groups used for container workloads",
"operationId": "getVolumeGroups",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "name",
"in": "query",
"description": "Volume group name",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/VolumeGroup"
}
}
}
}
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if the volume group name cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"post": {
"summary": "Create a new volume group for container workloads",
"operationId": "createVolumeGroup",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "The new volume group that is to be created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VolumeGroup"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VolumeGroup"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/volume_groups/{id}": {
"get": {
"summary": "Get the volume group with the given ID",
"operationId": "getVolumeGroup",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "Volume group ID",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VolumeGroup"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if volume group ID cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"delete": {
"summary": "Delete a volume group",
"operationId": "deleteVolumeGroup",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "The id of the volume group to delete",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not found if volume group ID is not found"
},
"409": {
"description": "Conflict if the volume group cannot be deleted"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/volume_group_snapshots": {
"get": {
"summary": "Get all volume group snapshots used for container workloads",
"operationId": "getVolumeGroupSnapshots",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "volume_group_id",
"in": "query",
"description": "Volume Group ID",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/VolumeGroupSnapshot"
}
}
}
}
},
"400": {
"description": "Bad Request if volume group ID is not provided"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
}
},
"post": {
"summary": "Create a volume group snapshot",
"operationId": "createVolumeGroupSnapshot",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "A new volume group snapshot that is to be created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VolumeGroupSnapshot"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VolumeGroupSnapshot"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/volume_group_snapshots/{id}": {
"get": {
"summary": "Get a volume group snapshot with the given ID",
"operationId": "getVolumeGroupSnapshot",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "Volume group snapshot ID",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VolumeGroupSnapshot"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if volume group snapshot ID cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"delete": {
"summary": "Delete a volume group snapshot",
"operationId": "deleteVolumeGroupSnapshot",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "The id of the volume group snapshot to delete",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not found if volume group snapshot ID is not found"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/volumes": {
"get": {
"summary": "Get all volumes used for container workloads",
"operationId": "getVolumes",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "name",
"in": "query",
"description": "Volume name",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ContainerVolume"
}
}
}
}
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if the volume name cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"post": {
"summary": "Create a new volume for container workloads",
"operationId": "createVolume",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "The new volume that is to be created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContainerVolume"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContainerVolume"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/volumes/{id}": {
"get": {
"summary": "Get the volume with the given ID",
"operationId": "getVolume",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "Volume ID",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContainerVolume"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if volume ID cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"put": {
"summary": "Edit the volume with the given ID",
"operationId": "editVolume",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "The id of the volume to edit",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "The volume details that are to be edited",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContainerVolume"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContainerVolume"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if volume ID cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"delete": {
"summary": "Delete a volume",
"operationId": "deleteVolume",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "The id of the volume to delete",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "force",
"in": "query",
"description": "Forces deletion of a volume. Bypasses any soft deletion strategy. This is used for ephemeral workflows.",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request if the volume is published"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not found if volume ID is not found"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/volumes/{id}/actions/publish": {
"put": {
"summary": "Publishes a volume to the given node",
"operationId": "publishVolume",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "The id of the volume to publish",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "The publish options for the volume",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublishOptions"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublishInfo"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if volume ID or node ID cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/volumes/{id}/actions/unpublish": {
"put": {
"summary": "Unpublishes a volume from the given node",
"operationId": "unpublishVolume",
"parameters": [
{
"name": "x-array-ip",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "x-auth-token",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"description": "The id of the volume to unpublish",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "The unpublish options for the volume",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnpublishOptions"
}
}
},
"required": true
},
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found if volume ID or node ID cannot be found"
},
"500": {
"description": "Internal Server Error"
}
}
}
}
},
"components": {
"schemas": {
"Host": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"uuid": {
"type": "string"
},
"iqns": {
"type": "array",
"items": {
"type": "string"
}
},
"wwpns": {
"type": "array",
"items": {
"type": "string"
}
},
"networks": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"ContainerVolumeSnapshot": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "integer",
"format": "int64"
},
"description": {
"type": "string"
},
"config": {
"$ref": "#/components/schemas/SnapshotConfig"
},
"volume_id": {
"type": "string"
},
"volume_name": {
"type": "string"
},
"creation_time": {
"type": "integer",
"format": "int64"
},
"ready_to_use": {
"type": "boolean"
}
}
},
"SnapshotConfig": {
"type": "object",
"properties": {
"online": {
"type": "boolean"
},
"writable": {
"type": "boolean"
}
}
},
"AccessToken": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"username": {
"type": "string"
},
"password": {
"type": "string"
},
"array_ip": {
"type": "string"
},
"session_token": {
"type": "string"
},
"creation_time": {
"type": "integer",
"format": "int64"
},
"expiry_time": {
"type": "integer",
"format": "int64"
}
}
},
"ContainerVolume": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "integer",
"format": "int64"
},
"description": {
"type": "string"
},
"clone": {
"type": "boolean"
},
"published": {
"type": "boolean"
},
"config": {
"$ref": "#/components/schemas/VolumeConfig"
},
"base_snapshot_id": {
"type": "string"
},
"volume_group_id": {
"type": "string"
}
}
},
"VolumeConfig": {
"type": "object",
"properties": {
"pool": {
"type": "string"
},
"folder": {
"type": "string"
},
"encrypted": {
"type": "boolean"
},
"thick": {
"type": "boolean"
},
"snapshot": {
"type": "string"
},
"takeover": {
"type": "boolean"
},
"performance_policy": {
"type": "string"
},
"perf_policy": {
"type": "string"
},
"protection_template": {
"type": "string"
},
"dedupe_enabled": {
"type": "boolean"
},
"limit_iops": {
"type": "integer",
"format": "int64"
},
"limit_mbps": {
"type": "integer",
"format": "int64"
},
"destroy_on_delete": {
"type": "boolean"
},
"sync_on_detach": {
"type": "boolean"
},
"volume_name_suffix": {
"type": "string"
},
"snapshot_name_prefix": {
"type": "string"
},
"clone_of": {
"type": "string"
},
"import_vol_as_clone": {
"type": "string"
},
"create_snapshot": {
"type": "boolean"
},
"import_volume_name": {
"type": "string"
},
"reverse_replication": {
"type": "boolean"
},
"force_import": {
"type": "boolean"
},
"target_scope": {
"type": "string",
"enum": ["volume", "group"]
}
}
},
"VolumeGroup": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"volumes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ContainerVolume"
}
}
}
},
"VolumeGroupSnapshot": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"snapshots": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ContainerVolumeSnapshot"
}
},
"volume_group_id": {
"type": "string"
},
"volume_group_name": {
"type": "string"
}
}
},
"PublishInfo": {
"type": "object",
"properties": {
"serial_number": {
"type": "string"
},
"target_name": {
"type": "string"
},
"access_protocol": {
"type": "string",
"enum": ["iscsi", "fc"]
},
"lun_id": {
"type": "integer",
"format": "int64"
},
"discovery_ip": {
"type": "string"
},
"chap_user": {
"type": "string"
},
"chap_password": {
"type": "string"
}
}
},
"PublishOptions": {
"type": "object",
"properties": {
"host_id": {
"type": "string"
},
"access_protocol": {
"type": "string",
"enum": ["iscsi", "fc"]
}
}
},
"UnpublishOptions": {
"type": "object",
"properties": {
"host_id": {
"type": "string"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment