API Actions: ActivateInstance
Once an instance is created from the CloudBasic AMI, it needs to be activated.
Attention: This API call uses non-standard authentication and does not require an Authorization header. At this point of a CloudBasic instance’s lifecycle there are no valid users and credentials created yet.
Request Syntax:
JSON
POST /api/ActivateInstance HTTP/1.1
Host: ApiHostEndPoint:82
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Content-Type: application/json
X-Amz-Date: 20171115T202130Z
Authorization: AWS4-HMAC-SHA256 Credential= UQOPWUVNBALABCABCABC/20171115/us-east-1/cloudbasic/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=995374189c189e8e68ed3de82c1764ca11971711fb5179eeab2b19edd883dd74
{
"email": "your-user@yourdomain.com",
"instanceId": "ec2_instance_id", -- EC2 Instance ID of the instance hosting the API is required for security reasons
"password": "admin-password", -- initial password for the default admin user; API key pair will be returned for the admin user; additional console or API users can be created via calling /api/CreateUser/
"isProduction": true,
"company": "CloudBasix",
"contactPerson": "First Last",
"activationKey": "XXXXXXXX-F057-4A2F-BEB3-643F1BE25HB6E", -- required for out of marketplace and BYOL instances on marketplaces
"agreeToEula": true, -- 12.301 and above; required - general EULA URL will be returned in response
"isVolumeActivationKey": false, -- 12.301 and above; not required, default = false; if set true this designates the activationKey as a Volume License Activation Key
"agreeToVolumeEula": false -- 12.301 and above; required if isVolumeActivationKey=true - volume EULA URL will be returned in response
}
XML
POST /api/ActivateInstance HTTP/1.1
Host: ApiHostEndPoint:82
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Content-Type: application/xml
X-Amz-Date: 20171115T202130Z
Authorization: AWS4-HMAC-SHA256 Credential= UQOPWUVNBALABCABCABC/20171115/us-east-1/cloudbasic/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=995374189c189e8e68ed3de82c1764ca11971711fb5179eeab2b19edd883dd74
<?xml version="1.0" encoding="utf-8"?>
<ActivateInstanceRequest>
<Email>user@yourdomain.com</Email>
<InstanceId>ec2_instance_id</InstanceId
<Password>admin-password</Password>
<IsProduction>true</IsProduction>
<Company>MyCompany</Company>
<ContactPerson>John Doe</ContactPerson>
<ActivationKey>XXXXXXXX-F057-4A2F-BEB3-643F1BE25HB6E</ActivationKey> <!-- required for out of marketplace and BYOL instances on marketplaces -->
<AgreeToEula>true</AgreeToEula> <!-- 12.301 and above; required - general EULA URL will be returned in response -->
<IsVolumeActivationKey>false</IsVolumeActivationKey> <!-- 12.301 and above; not required, default = false -->
<AgreeToVolumeEula>true</AgreeToVolumeEula> <!-- 12.301 and above; required if isVolumeActivationKey=true - volume EULA URL will be returned in response -->
</ActivateInstanceRequest>
Request Parameters
| Parameter | Description | Required |
|---|---|---|
| A character string that represents a valid email address. This email address will be associated with the first CloudBasic user with Administrator rights and must be used when the user is logging into the CloudBasic console. | Yes | |
| Type: String Default: None |
||
| InstanceId | The EC2 Instance ID of the CloudBasic instance you are trying to activate. | Yes |
| Type: String Default: None |
||
| Password | The default password that will be used when trying to login to the CloudBasic console. | Yes |
| Type: String Default: None |
||
| IsProduction | Indicates whether this instance is intended for production or testing use. Production instances need to be configured with defaults for fast, consistent performance and enabled for high-availability. Go to http://hacluster.cloudbasic.net to learn more. To cluster this instance with another CloudBasic instance d in a different zone, see CreateCluster API method. To test clustering in the UI, go to \Advanced\Multi-AZ HA Cluster. | Yes |
| Type: String Default: None Valid value: true/ false |
||
| Company | The name of your organization. | Yes |
| Type: String Default: None |
||
| ContactPerson | The name of the person who can be contacted regarding issues with this instance. | No |
| Type: String Default: None |
||
| ActivationKey | Important***: required only for out-of-marketplace (instances launched from AMIs provided by CloudBasix) and BYOL instances on marketplaces (AWS, Azure, Google Cloud). Not required for non-BYOL instances launched from marketplaces.
A one-time instance specific activation key provided by CloudBasic. This attribute is applicable only to instances activated outside of the AWS, Google Cloud, Oracle Cloud, IBM CLoud and Alibaba Cloud Marketplaces. |
*** |
| Type: String Default: None |
||
| AgreeToEula
(12.301 and above) |
*** | |
| Type: String Default: false |
||
| IsVolumeActivationKey
(12.301 and above) |
*** | |
| Type: String Default: false |
||
| agreeToVolumeEula
(12.301 and above) |
*** | |
| Type: String Default: false |
Request Headers
This implementation uses only request headers that are common to all operations. For more information please see the section Common Request Headers
Response Syntax:
JSON
HTTP/1.1 200
status: 200
{
"adminUsername": "admin",
"publicKey": "GUFBSWGOFWLPBDNKFSXE",
"privateKey": "hKwIrkxKgFPgNtXYNZj/9X2kPWPtISIHoOwAh0hv",
"eulaUrl": "https://xxxxxxx.com/terms", -- 12.301 and above: EULA agreed to by passing "agreeToEula": true
"note": "If do not agree to the EULA, deactivate the instance by calling /api/DeactivateInstance" --12.301 and above only
"instanceSize: "M5.Xlarge", -- 12.301 and above: returns the instance type/size - for volume license activations this value is to be used to maintained log of subscription types.
"volumeEulaUrl:{https://xxxxxxx.com/VolumeLicenseTerms}, -- 12.301 and above: Volume EULA agreed to by passing "agreeToVolumeEula": true
"volumeInstanceActivationKey: "XXXXXXXX-5475-XXXXXXXXXXXXXXX" -- 12.301 the system generated key (if "isVolumeActivationKey": true) under which the instance is activated (under Volume EULA)
}
XML
HTTP/1.1 200
status: 200
<?xml version="1.0" encoding="utf-8"?>
<ActivateInstanceResponse>
<AdminUsername>admin</AdminUsername>
<PublicKey>GUFBSWGOFWLPBDNKFSXE</PublicKey>
<PrivateKey>hKwIrkxKgFPgNtXYNZj/9X2kPWPtISIHoOwAh0hv</PrivateKey>
<EulaUrl>https://xxxxxxx.com/terms</EulaUrl> -- 12.301 and above: EULA agreed to by passing AgreeToEula=true
<Note>If do not agree to the EULA, deactivate the instance by calling /api/DeactivateInstance"</Note> --12.301 and above only
<InstanceSize>M5.Xlarge<InstanceSize> <!-- 12.301 and above: returns the instance type/size - for volume license activations this value is to be used to maintained log of subscription types-->
<VolumeEulaUrl>https://xxxxxxx.com/VolumeLicenseTerms </VolumeEulaUrl> <!-- 12.301 and above: Volume EULA agreed to by passing "agreeToVolumeEula": true -->
<VolumeInstanceActivationKey>XXXXXXXX-5475-XXXXXXXXXXXXXXX</VolumeInstanceActivationKey> <!-- 12.301 the system generated key (if "isVolumeActivationKey": true) under which the instance is activated (under Volume EULA) -->
</ActivateInstanceResponse>
Response Parameters
| Parameter | Description | Optional |
|---|---|---|
| AdminUsername | The User Name of the user that was just created as part of the Instance Activation process. This user has Administrative privileges. | No |
| PublicKey | This is the Public Key required to authenticate requests to the CloudBasic API. For more information please see the section API Security Attention: This is the only time this value will be returned by the API. There are no other ways to retrieve this value. |
No |
| PrivateKey | This is the Private Key required to authenticate requests to the CloudBasic API. For more information please see the section API Security Attention: This is the only time this value will be returned by the API. There are no other ways to retrieve this value. |
No |
Error Response Syntax:
JSON
HTTP/1.1 400
status: 400
{
"errors": [
"{Email}:Invalid value for Email",
"{InstanceId}:Invalid value for InstanceId"
],
"requestId": 20
}
XML
HTTP/1.1 400 status: 400 <?xml version="1.0" encoding="utf-8"?> <ErrorResponse> <RequestId>request-id</RequestId> <Errors> <Error> <Message>Error message 1</Message> </Error> <Error> <Message>Error message 2</Message> </Error> </Errors> </ErrorResponse>
