Impossible Cloud Distributors API

The Distributors API from Impossible Cloud — 11 operation(s) for distributors.

OpenAPI Specification

impossible-cloud-distributors-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  contact: {}
  description: 'Public API designed to help our partners to automate their tasks.

    Log in to Management Console, create API Key for your automation or reporting process and provide it in "Authorization" header per every request.'
  title: Impossible Cloud Management Console public Distributors API
  version: '1.0'
host: api.partner.impossiblecloud.com
basePath: /v1
schemes:
- https
tags:
- name: Distributors
paths:
  /contract/list:
    get:
      description: This endpoint retrieves a list of available contracts.
      responses:
        '200':
          description: OK
          schema:
            items:
              $ref: '#/definitions/api.DistributorContractResponse'
            type: array
      security:
      - Bearer: []
      summary: Get list of available contracts
      tags:
      - Distributors
  /contract/{contractID}/partners:
    get:
      description: 'This endpoint retrieves a list of partners associated with a specific contract.

        Use Case: As a Distributor, I want to list all available Partners in a specific contract.'
      parameters:
      - description: The unique identifier (UUID) of the contract for which the partners are to be listed
        format: uuid
        in: path
        name: contractID
        required: true
        type: string
      responses:
        '200':
          description: OK
          schema:
            items:
              $ref: '#/definitions/api.DistributorPartnerResponse'
            type: array
      security:
      - Bearer: []
      summary: Get list of partners in the contract
      tags:
      - Distributors
  /partner:
    post:
      description: 'This endpoint allows the creation of a new partner within a specific contract. It is designed for distributors to add partners to their contracts efficiently.

        Use Case: As a Distributor, I want to create a new Partner within a specific contract to expand my network and manage my contractual relationships.'
      parameters:
      - description: Partner details
        in: body
        name: partnerDetails
        required: true
        schema:
          $ref: '#/definitions/api.CreatePartnerReqBody'
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/api.DistributorPartnerResponse'
      security:
      - Bearer: []
      summary: Create partner in the contract
      tags:
      - Distributors
  /partner/{partnerID}:
    delete:
      description: Deletes an empty partner. Fails if the partner already has storage accounts associated.
      parameters:
      - description: The unique identifier (UUID) of the partner to be deleted
        format: uuid
        in: path
        name: partnerID
        required: true
        type: string
      responses:
        '204':
          description: No Content
      security:
      - Bearer: []
      summary: Delete a partner
      tags:
      - Distributors
    get:
      parameters:
      - description: The unique identifier of the partner to be retrieved
        in: path
        name: partnerID
        required: true
        type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/api.DistributorPartnerResponse'
      security:
      - Bearer: []
      summary: Get a partner by identifier
      tags:
      - Distributors
    put:
      description: This endpoint enables a distributor to update a partner's name or allocated capacity.
      parameters:
      - description: The unique identifier (UUID) of the partner whose details are to be updated
        format: uuid
        in: path
        name: partnerID
        required: true
        type: string
      - description: Name and/or allocation. Both parameters are optional.
        in: body
        name: partnerDetails
        required: true
        schema:
          $ref: '#/definitions/api.UpdatePartnerReqBody'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/api.DistributorPartnerResponse'
      security:
      - Bearer: []
      summary: Change partner's name or allocation
      tags:
      - Distributors
  /partner/{partnerID}/member:
    post:
      description: 'This endpoint facilitates the creation of a Management Console user for a specific distributor partner.

        Use Case: As a Distributor, I can create Management Console users (Members) for a specific Partner by its ID,'
      parameters:
      - description: The unique identifier (UUID) of the partner for whom the Management Console user is to be created
        format: uuid
        in: path
        name: partnerID
        required: true
        type: string
      - description: User details
        in: body
        name: memberDetails
        required: true
        schema:
          $ref: '#/definitions/api.CreateMemberReqBody'
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/api.DistributorPartnerMembersResponse'
      security:
      - Bearer: []
      summary: Create Management Console user for specific distributor partner
      tags:
      - Distributors
  /partner/{partnerID}/member/{memberID}:
    delete:
      description: This endpoint facilitates the removal of a Management Console user for a specific distributor partner.
      parameters:
      - description: The unique identifier (UUID) of the partner for whom the Management Console user is to be removed
        format: uuid
        in: path
        name: partnerID
        required: true
        type: string
      - description: The unique identifier (UUID) of the member to be removed
        format: uuid
        in: path
        name: memberID
        required: true
        type: string
      responses:
        '204':
          description: No Content
      security:
      - Bearer: []
      summary: Remove Management Console user for a specific distributor partner
      tags:
      - Distributors
  /partner/{partnerID}/members:
    get:
      parameters:
      - description: The unique identifier (UUID) of the partner for whom the Management Console users is to be listed
        format: uuid
        in: path
        name: partnerID
        required: true
        type: string
      responses:
        '200':
          description: OK
          schema:
            items:
              $ref: '#/definitions/api.DistributorPartnerMembersResponse'
            type: array
      security:
      - Bearer: []
      summary: List Management Console users for specific distributor partner
      tags:
      - Distributors
  /partner/{partnerID}/storage-accounts:
    get:
      parameters:
      - description: The unique identifier of the partner
        in: path
        name: partnerID
        required: true
        type: string
      responses:
        '200':
          description: OK
          schema:
            items:
              $ref: '#/definitions/api.StorageAccountResponse'
            type: array
      security:
      - Bearer: []
      summary: Get list of available storage accounts
      tags:
      - Distributors
    post:
      parameters:
      - description: The unique identifier of the partner
        in: path
        name: partnerID
        required: true
        type: string
      - description: Storage account details
        in: body
        name: storageAccountDetails
        required: true
        schema:
          $ref: '#/definitions/api.CreateStorageAccountReqBody'
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/api.StorageAccountResponse'
      security:
      - Bearer: []
      summary: Create a storage account for a partner
      tags:
      - Distributors
  /partner/{partnerID}/storage-accounts/{accountID}:
    delete:
      description: By default the storage account will be deleted in 30 days after scheduling.
      parameters:
      - description: Storage account identifier
        in: path
        name: accountID
        required: true
        type: string
      - description: The unique identifier of the partner
        in: path
        name: partnerID
        required: true
        type: string
      responses:
        '204':
          description: No Content
      security:
      - Bearer: []
      summary: Schedule the deletion of a storage account
      tags:
      - Distributors
    get:
      parameters:
      - description: Storage Account identifier
        in: path
        name: accountID
        required: true
        type: string
      - description: The unique identifier of the partner
        in: path
        name: partnerID
        required: true
        type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/api.StorageAccountResponse'
      security:
      - Bearer: []
      summary: Get account info by accountID
      tags:
      - Distributors
    patch:
      parameters:
      - description: Storage Account ID you can find in /partner/{partnerID}/storage-account/list
        in: path
        name: accountID
        required: true
        type: string
      - description: Storage account details
        in: body
        name: storageAccountDetails
        required: true
        schema:
          $ref: '#/definitions/api.PatchStorageAccountReqBody'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/api.StorageAccountResponse'
      security:
      - Bearer: []
      summary: Update information of an account by accountID
      tags:
      - Distributors
  /partner/{partnerID}/storage-accounts/{accountID}/usage:
    get:
      parameters:
      - description: Storage Account identifier
        in: path
        name: accountID
        required: true
        type: string
      - description: The unique identifier of the partner
        in: path
        name: partnerID
        required: true
        type: string
      - description: Start of the timeframe from where the data should be shown
        format: yyyy-mm-dd
        in: query
        name: from
        required: true
        type: string
      - description: End of the timeframe from where the data should be shown
        format: yyyy-mm-dd
        in: query
        name: to
        required: true
        type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/api.ClientUsage'
      security:
      - Bearer: []
      summary: Retrieves the usage of the storage account of a given distributor partner
      tags:
      - Distributors
  /partner/{partnerID}/usage:
    get:
      description: This Endpoint is used to retrieve the usage information of each storage account a specific distributor partner has.
      parameters:
      - description: The unique identifier (UUID) of the partner for whom the Management Console users is to be listed
        format: uuid
        in: path
        name: partnerID
        required: true
        type: string
      - description: Start of the timeframe from where the data should be shown
        format: yyyy-mm-dd
        in: query
        name: from
        required: true
        type: string
      - description: End of the timeframe from where the data should be shown
        format: yyyy-mm-dd
        in: query
        name: to
        required: true
        type: string
      responses:
        '200':
          description: OK
          schema:
            items:
              $ref: '#/definitions/api.ClientUsage'
            type: array
      security:
      - Bearer: []
      summary: Retrieves the usage of all the storage accounts of a given distributor partner
      tags:
      - Distributors
definitions:
  api.PatchStorageAccountReqBody:
    properties:
      pendingDeletedAt:
        type: string
        x-nullable: true
    type: object
  api.CreateStorageAccountReqBody:
    properties:
      allocatedCapacity:
        minimum: 0
        type: integer
      allowOverdraft:
        type: boolean
      clientAccount:
        $ref: '#/definitions/api.StorageAccountClientAccount'
      name:
        type: string
    required:
    - allocatedCapacity
    - allowOverdraft
    - clientAccount
    - name
    type: object
  api.DistributorPartnerResponse:
    properties:
      allocatedCapacity:
        description: The capacity allocated to this partner under the contract
        type: integer
      allowOverdraft:
        description: Indicates if the partner can go over it's allocated capacity
        type: boolean
      details:
        description: Additional details about the partner
        type: string
      distributorContractId:
        description: The ID of the distributor's contract (UUID)
        type: string
      id:
        description: The unique identifier of the partner (UUID)
        type: string
      name:
        description: The name of the partner
        type: string
    type: object
  api.CreateMemberReqBody:
    properties:
      email:
        description: Email address of the new user
        type: string
      name:
        description: The name of the new user
        type: string
      password:
        description: Password for the new user
        type: string
      role:
        description: 'Role assigned to the new user within the Partner Portal. Might be one of the following: admin, staff, viewer'
        type: string
    required:
    - email
    - password
    - role
    type: object
  api.UpdatePartnerReqBody:
    properties:
      allocatedCapacity:
        description: The updated capacity allocated to this partner
        minimum: 0
        type: integer
      name:
        description: The new name of the partner
        type: string
    type: object
  api.StorageAccountClientAccount:
    properties:
      contactEmail:
        type: string
      password:
        description: 'Password The password of the account.

          The following requirements apply to the password:

          - must be at least 8 characters and no more than 128 characters in length

          - must contain at lease one special character: !"#$%&''()*+,-./:;<=>?@[\]^_`{|}~

          - must contain lower-case (a-z), upper-case (A-Z) and number (0-9) characters'
        type: string
    required:
    - contactEmail
    - password
    type: object
  api.DailyUsage:
    properties:
      allocated_capacity:
        type: integer
      date:
        type: string
      usage:
        type: integer
    type: object
  api.DistributorPartnerMembersResponse:
    properties:
      email:
        type: string
      id:
        type: string
      name:
        type: string
      role:
        type: string
    type: object
  api.ClientUsage:
    properties:
      allocated_capacity:
        type: integer
      client_id:
        type: string
      daily_usage:
        items:
          $ref: '#/definitions/api.DailyUsage'
        type: array
      name:
        type: string
    type: object
  api.CreatePartnerReqBody:
    properties:
      allocatedCapacity:
        description: The capacity allocated to this new partner
        minimum: 0
        type: integer
      allowOverdraft:
        description: Indicated if the partner can go over its allocated capacity
        type: boolean
      distributorContractId:
        description: UUID of the distributor's contract with which the partner is to be associated
        type: string
      name:
        description: The name of the new partner
        type: string
    required:
    - allocatedCapacity
    - distributorContractId
    - name
    type: object
  api.StorageAccountResponse:
    properties:
      allocatedCapacity:
        type: integer
      allowOverdraft:
        type: boolean
      clientAccountId:
        type: string
      contactEmail:
        type: string
      name:
        type: string
      pendingDeletedAt:
        type: string
    type: object
  api.DistributorContractResponse:
    properties:
      allocatedCapacity:
        description: The amount of capacity currently allocated under this contract
        type: integer
      costEgressGBCents:
        description: 'Deprecated: should not be used and is always 0'
        type: number
      costStorageGBCents:
        description: The cost per GB for storage
        type: number
      currency:
        description: The currency in which the costs are denominated
        type: string
      details:
        description: Additional details about the contract
        type: string
      distributorId:
        description: The unique identifier of the distributor for this contract
        type: string
      id:
        description: The unique identifier of the contract
        type: string
      reservedCapacity:
        description: The amount of capacity reserved under this contract
        type: integer
    type: object
securityDefinitions:
  Bearer:
    description: Type "Bearer" followed by a space and JWT token.
    in: header
    name: Authorization
    type: apiKey