pem.activateSubscription

This method is supported by Operations starting from version 2.3.01.

This method creates subscription, sets resource limits for this subscription, and then executes subscription provisioning.

There are the following use cases of this method:

  • Call pem.activateSubscription without parameters array passing. The system creates Subscription and performs provisioning. To add a Domain, pem.addDomain should be called separately.
  • Call pem.activateSubscription with parameters array passing. The system creates Subscription and Domain with physical hosting turned on, after that the provisioning takes place.

The method has the following input parameters:

Name

Type

Short Description

[subscription_id]

int

The ID of the Subscription to activate.

If the parameter is not specified
then ID for new Subscription will be generated by the system.

[subscription_name]

string

The name of Subscription.

account_id

int

The ID of Account to subscribe

service_template_id

int

The ID of the Service Template that should be used for Subscription creation.

[resource_limits]

array of struct

Subscription resource limits. It is optional parameter. If omitted then Service Template’s limits are used.

  • resource_id

int

Resource Type ID.

  • [resource_limit]

int

Resource Type limit.

Parameters resource_limit and resource_limit64 are optional to each other.

Note: Use -1 value to make a resource unlimited.

  • [resource_limit64]

bigint

Resource Type limit. It is 64bit analog of resource_limit parameter. Parameters resource_limit and resource_limit64 are optional to each other.

Note: Use -1 value to make a resource unlimited.

[parameters]

array of struct

The array of parameters (var_name, var_value) pairs that should be used during Subscription resources provisioning. It is optional parameter. Each element of array is a struct of two string values, the first is the parameter name, the second is the parameter value. The table of parameters supported is provided below.

  • var_name

string

Parameter name.

  • var_value

string

Parameter value.

[account_wide_su]

boolean

It is an optional parameter. Defines whether the Subscription will be used in Account-wide mode.

Note: Switching subscription to the Account-wide mode is permanent. It is impossible to switch Subscription back to the Subscription-local mode.

The table of parameters supported:

Name

Value

domain_id

The ID of Domain. If omitted, the system will assign the ID to Domain automatically. Otherwise, specified Domain ID value will be used.

domain_name

The name of Domain to create.

apache_homedir_path

The custom Webspace’s location relative the Webspaces Root directory of the Apache Web Server. If the parameter is omitted, an ID of a Webspace is used as default value.

Examples:

  • The Webspaces Root directory of the Apache Web Server is /usr/local/pem/vhosts/ and the apache_homedir_path parameter’s value is dir01/dir02/. In this case a Webspace is provisioned in /usr/local/pem/vhosts/dir01/dir02/ directory.
  • The Webspaces Root directory of the Apache Web Server is /usr/local/pem/vhosts/ and the apache_homedir_path parameter is omitted. In this case Operations generates the ID of a Webspace and the Webspace is provisioned in /usr/local/pem/vhosts/<ID of a Webspace>/ directory.

registrar_status

Registrar status of Domain. Possible values:

  • 0 – Domain check result is undefined.
  • 1 – Domain is not registered.
  • 2 – Domain is registered.

If omitted, 2 (Domain is registered) is used by default.

The method has the following output parameters:

Name

Type

Short Description

subscription_id

int

The ID of the Subscription created.

auto_provisioning_result

array of struct

The result of Subscription auto-provisioning. It contains information about the provisioned Resources.

It is not empty if Hosting Modules to which Resources belong use this parameter to return an additional information.

  • rt_id

int

Resource Type ID of provisioned Resource.

  • rt_parameters

array of struct

Information about the provisioned Resource.

  • parameter_name

string

Parameter name.

  • parameter_value

string

Parameter value.

For XML-RPC sample of using this method see pem.activateSubscription Sample in XML-RPC Samples appendix.