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

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

     Methods: GET, POST

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

Method GET: List all accounts.

       URL: GET /platform/<<version=3>>/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": "object", 
  "properties": {
    "total": {
      "type": "integer", 
      "description": "Total number of items available."
    }, 
    "accounts": {
      "items": {
        "type": "object", 
        "description": "A cloud account object", 
        "properties": {
          "account_id": {
            "type": "string", 
            "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"
          }, 
          "uri": {
            "type": "string", 
            "description": "A valid URI pointing to the location of the cloud storage"
          }, 
          "storage_region": {
            "type": [
              "string", 
              "null"
            ], 
            "description": "(S3 only) An appropriate region for the S3 account.  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"
          }, 
          "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", 
              "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 and \"s3\" for Amazon S3"
          }, 
          "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"
    }, 
    "resume": {
      "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=3>>/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", 
      "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": "(S3 only) An appropriate region for the S3 account.  For example, faster access times may be gained by referencing a nearby region"
    }, 
    "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", 
        "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 and \"s3\" for Amazon S3", 
      "required": true
    }, 
    "name": {
      "required": true, 
      "type": "string", 
      "description": "A unique name for this account"
    }
  }
}

POST response body schema:
{
  "type": "object", 
  "properties": {
    "id": {
      "type": "string", 
      "description": "The name of the new account"
    }
  }
}
