Resource URL: /platform/<<version=4>>/cloud/accounts

    Overview: This resource applies the standard collection pattern to accounts.

     Methods: GET, POST

********************************************************************************

Method GET: List all accounts.

       URL: GET /platform/<<version=4>>/cloud/accounts

Query arguments:
  sort=<string> The field that will be used for sorting.
limit=<integer> Return no more than this many results at once (see resume).
     dir=<enum> Where <enum> is one of ASC, DESC.  The direction of the sort.

GET response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "additionalProperties": false, 
      "type": "object", 
      "properties": {
        "total": {
          "minimum": 0, 
          "type": "integer", 
          "description": "Total number of items available.", 
          "maximum": 4294967295
        }, 
        "accounts": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "description": "A cloud account object", 
            "properties": {
              "account_id": {
                "type": [
                  "string", 
                  "integer"
                ], 
                "description": "(S3 only) The user id of the S3 account"
              }, 
              "metadata_bucket": {
                "type": "string", 
                "description": "The machine generated name of the account bucket to store metadata"
              }, 
              "account_username": {
                "type": "string", 
                "description": "The username required to authenticate against the cloud service"
              }, 
              "birth_cluster_id": {
                "type": "string", 
                "description": "The guid of the cluster where this account was created"
              }, 
              "telemetry_bucket": {
                "type": "string", 
                "description": "(S3 only) The name of the bucket into which generated metrics reports are placed by the cloud service provider"
              }, 
              "bucket": {
                "type": "string", 
                "description": "The machine generated name of the account bucket to store data"
              }, 
              "skip_account_check": {
                "type": "boolean", 
                "description": "(Not recommended) Indicates whether to skip validation that the cloud account is still accessible"
              }, 
              "uri": {
                "type": "string", 
                "description": "A valid URI pointing to the location of the cloud storage"
              }, 
              "storage_region": {
                "type": [
                  "string", 
                  "null"
                ], 
                "description": "An appropriate region for the account as defined by the cloud service provider.  For example, faster access times may be gained by referencing a nearby region"
              }, 
              "state_details": {
                "type": "string", 
                "description": "Gives further information to describe the state of this account"
              }, 
              "proxy": {
                "type": [
                  "string", 
                  "null"
                ], 
                "description": "The id or name of a proxy to be used by this account"
              }, 
              "state": {
                "enum": [
                  "OK", 
                  "disabled", 
                  "unreachable"
                ], 
                "type": "string", 
                "description": "Indicates whether this account is in a good state (\"OK\"), disabled (\"disabled\") or inaccessible via the network (\"unreachable\")"
              }, 
              "pool": {
                "type": "string", 
                "description": "Name of the pool referencing this account.  Empty if none."
              }, 
              "key": {
                "type": "string", 
                "description": "A valid authentication key for connecting to the cloud"
              }, 
              "skip_ssl_validation": {
                "type": "boolean", 
                "description": "Indicates whether to skip SSL certificate validation when connecting to the cloud"
              }, 
              "type": {
                "enum": [
                  "isilon", 
                  "ecs", 
                  "virtustream", 
                  "azure", 
                  "s3", 
                  "google", 
                  "ran", 
                  "ecs2"
                ], 
                "type": "string", 
                "description": "The type of cloud protocol required.  E.g., \"isilon\" for EMC Isilon, \"ecs\" for EMC ECS Appliance, \"virtustream\" for Virtustream Storage Cloud, \"azure\" for Microsoft Azure, \"s3\" for Amazon S3 and \"google\" for Google Cloud Platform"
              }, 
              "id": {
                "type": "string", 
                "description": "A globally unique name for this account"
              }, 
              "enabled": {
                "type": "boolean", 
                "description": "Whether this account is explicitly enabled or disabled by a user"
              }, 
              "name": {
                "type": "string", 
                "description": "A unique name for this account"
              }
            }
          }, 
          "type": "array", 
          "maxItems": 4294967295
        }, 
        "resume": {
          "minLength": 0, 
          "type": [
            "string", 
            "null"
          ], 
          "description": "Continue returning results from previous call using this token (token should come from the previous call, resume cannot be used with other options)."
        }
      }
    }
  ]
}

********************************************************************************

Method POST: Create a new account.

        URL: POST /platform/<<version=4>>/cloud/accounts

There are no query arguments for this method.

Required POST request body fields:
account_username, uri, key, type, name

POST request body schema:
{
  "type": "object", 
  "description": "A cloud account object", 
  "properties": {
    "account_id": {
      "type": [
        "string", 
        "integer"
      ], 
      "description": "(S3 only) The user id of the S3 account"
    }, 
    "account_username": {
      "required": true, 
      "type": "string", 
      "description": "The username required to authenticate against the cloud service"
    }, 
    "birth_cluster_id": {
      "type": "string", 
      "description": "The guid of the cluster where this account was created"
    }, 
    "telemetry_bucket": {
      "type": "string", 
      "description": "(S3 only) The name of the bucket into which generated metrics reports are placed by the cloud service provider"
    }, 
    "enabled": {
      "type": "boolean", 
      "description": "Whether this account is explicitly enabled or disabled by a user"
    }, 
    "uri": {
      "required": true, 
      "type": "string", 
      "description": "A valid URI pointing to the location of the cloud storage"
    }, 
    "storage_region": {
      "type": [
        "string", 
        "null"
      ], 
      "description": "An appropriate region for the account as defined by the cloud service provider.  For example, faster access times may be gained by referencing a nearby region"
    }, 
    "proxy": {
      "type": [
        "string", 
        "null"
      ], 
      "description": "The id or name of a proxy to be used by this account"
    }, 
    "key": {
      "required": true, 
      "type": "string", 
      "description": "A valid authentication key for connecting to the cloud"
    }, 
    "skip_ssl_validation": {
      "type": "boolean", 
      "description": "Indicates whether to skip SSL certificate validation when connecting to the cloud"
    }, 
    "type": {
      "enum": [
        "isilon", 
        "ecs", 
        "virtustream", 
        "azure", 
        "s3", 
        "google", 
        "ran", 
        "ecs2"
      ], 
      "type": "string", 
      "description": "The type of cloud protocol required.  E.g., \"isilon\" for EMC Isilon, \"ecs\" for EMC ECS Appliance, \"virtustream\" for Virtustream Storage Cloud, \"azure\" for Microsoft Azure, \"s3\" for Amazon S3 and \"google\" for Google Cloud Platform", 
      "required": true
    }, 
    "name": {
      "required": true, 
      "type": "string", 
      "description": "A unique name for this account"
    }
  }
}

POST response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "type": "object", 
      "properties": {
        "id": {
          "type": "string", 
          "description": "The name of the new account"
        }
      }
    }
  ]
}
