Switching a customer tenant to production mode

A customer tenant that is using services in the trial mode can be switched to the production mode only once.

If you switch the mode from trial to production in the middle of a month, the entire month will be included in the monthly service usage report. For this reason, we recommend that you switch the mode on the first day of a month.

The mode is automatically switched to production when the tenant remains in the trial mode for one full month.

The tenant mode is available in the tenant pricing settings.

Warning

Switching a tenant mode is not a reversible operation.

Step-by-step procedure

  1. Authenticate to the cloud platform via the Python shell.

    The following variables should be available now:

    >>> base_url  # the base URL of the API
    'https://eu2-cloud.acronis.com/api/2'
    >>> auth  # the 'Authorization' header value with the access token
    {'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImMwMD...'}
    >>> tenant_id  # the UUID of the tenant to which the token provides access
    'ede9f834-70b3-476c-83d9-736f9f8c7dae'
    
  2. Assign either of the following values to the tenant_id variable – the UUID of a sub-tenant created via the API or a sub-tenant found by its name:

    >>> tenant_id = created_tenant_id
    >>> tenant_id
    '0fcd4a69-8a40-4de8-b711-d9c83dc000f7'
    
  3. Fetch the tenant pricing settings by sending a GET request to the /tenants/{tenant_id}/pricing endpoint:

    >>> response = requests.get(f'{base_url}/tenants/{tenant_id}/pricing', headers=auth)
    
  4. Check the status code of the response:

    >>> response.status_code
    200
    

    Status code 200 means that the response body contains the tenant pricing settings formatted as a JSON text.

    A different status code means that an error has occurred. For the details, refer to “Status and error codes”.

  5. Convert the JSON text that the response body contains to an object, and then store this object in a variable named tenant_pricing:

    >>> tenant_pricing = response.json()
    >>> pprint.pprint(tenant_pricing)
    {'currency': None,
    'mode': 'trial',
    'production_start_date': '2020-08-04T12:47:03',
    'version': 1596545222672}
    
  6. Change the value of the mode key to production in the tenant_pricing object:

    >>> tenant_pricing['mode'] = 'production'
    
  7. Convert the tenant_pricing object to a JSON text:

    >>> tenant_pricing = json.dumps(tenant_pricing, indent=4)
    
  8. Send a PUT request with the JSON text to the /tenants/{tenant_id}/pricing endpoint:

    >>> response = requests.put(
    ...     f'{base_url}/tenants/{tenant_id}/pricing',
    ...     headers={'Content-Type': 'application/json', **auth},
    ...     data=tenant_pricing,
    ... )
    
  9. Check the status code of the response:

    >>> response.status_code
    200
    

    Status code 200 means that the platform has switched the tenant to the production mode.

    A different status code means that an error has occurred. For the details, refer to “Status and error codes”.