activationkey

Description

Contains methods to access common activation key functions available from the web interface.

Namespace:

activationkey

Method: addChildChannels

Description:

Add child channels to an activation key.

Parameters:

  • string sessionKey

  • string key

  • array :

    • string - childChannelLabel

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: addConfigChannels

Description:

Given a list of activation keys and configuration channels, this method adds given configuration channels to either the top or the bottom (whichever you specify) of an activation key’s configuration channels list. The ordering of the configuration channels provided in the add list is maintained while adding. If one of the configuration channels in the 'add' list already exists in an activation key, the configuration channel will be re-ranked to the appropriate place.

Parameters:

  • string sessionKey

  • array :

    • string - activationKey

  • array :

    • string - List of configuration channel labels in the ranked order.

  • boolean addToTop

  • true - To prepend the given channels to the beginning of the activation key’s config channel list

  • false - To append the given channels to the end of the activation key’s config channel list

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: addEntitlements

Description:

Add add-on System Types to an activation key.

Parameters:

  • string sessionKey

  • string key

  • array string - Add-on system type labels to associate with the key.

    • container_build_host

    • monitoring_entitled

    • osimage_build_host

    • virtualization_host

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: addPackageNames (Deprecated)

Description:

Add packages to an activation key using package name only.

Deprecated - being replaced by addPackages(string sessionKey, string key, array[packages])

Parameters:

  • string sessionKey

  • string key

  • array :

    • string - packageName

Returns:

  • int - 1 on success, exception thrown otherwise.

Available since API version: 10.2

Method: addPackages

Description:

Add packages to an activation key.

Parameters:

  • string sessionKey

  • string key

  • array :

    • struct - packages

      • string "name" - Package name

      • string "arch" - Arch label - Optional

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: addServerGroups

Description:

Add server groups to an activation key.

Parameters:

  • string sessionKey

  • string key

  • array :

    • int - serverGroupId

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: checkConfigDeployment

Description:

Check configuration file deployment status for the activation key specified.

Parameters:

  • string sessionKey

  • string key

Returns:

  • int status - 1 if enabled, 0 if disabled, exception thrown otherwise

Method: clone

Description:

Clone an existing activation key.

Parameters:

  • string sessionKey

  • string key - Key to be cloned.

  • string cloneDescription - Description of the cloned key.

Returns:

  • string The new activation key

Method: create

Description:

Create a new activation key. The activation key parameter passed in will be prefixed with the organization ID, and this value will be returned from the create call.

Eg. If the caller passes in the key "foo" and belong to an organization with
the ID 100, the actual activation key will be "100-foo".
This call allows for the setting of a usage limit on this activation key.
If unlimited usage is desired see the similarly named API method with no
usage limit argument.

Parameters:

  • string sessionKey

  • string key - Leave empty to have new key autogenerated.

  • string description

  • string baseChannelLabel - Leave empty to accept default.

  • int usageLimit - If unlimited usage is desired, use the create API that does not include the parameter.

  • array string - Add-on system type labels to associate with the key.

    • container_build_host

    • monitoring_entitled

    • osimage_build_host

    • virtualization_host

  • boolean universalDefault

Returns:

  • string The new activation key

Method: create

Description:

Create a new activation key with unlimited usage. The activation key parameter passed in will be prefixed with the organization ID, and this value will be returned from the create call.

Eg. If the caller passes in the key "foo" and belong to an organization with
the ID 100, the actual activation key will be "100-foo".

Parameters:

  • string sessionKey

  • string key - Leave empty to have new key autogenerated.

  • string description

  • string baseChannelLabel - Leave empty to accept default.

  • array string - Add-on entitlement label to associate with the key.

    • virtualization_host

  • boolean universalDefault

Returns:

  • string The new activation key

Method: delete

Description:

Delete an activation key.

Parameters:

  • string sessionKey

  • string key

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: disableConfigDeployment

Description:

Disable configuration file deployment for the specified activation key.

Parameters:

  • string sessionKey

  • string key

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: enableConfigDeployment

Description:

Enable configuration file deployment for the specified activation key.

Parameters:

  • string sessionKey

  • string key

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: getDetails

Description:

Lookup an activation key’s details.

Parameters:

  • string sessionKey

  • string key

Returns:

  • * struct - activation key

    • string "key"

    • string "description"

    • int "usage_limit"

    • string "base_channel_label"

    • array "child_channel_labels"

      • string - childChannelLabel

    • array "entitlements"

      • string - entitlementLabel

    • array "server_group_ids"

      • string - serverGroupId

    • array "package_names"

      • string - packageName - (deprecated by packages)

    • array "packages"

      • struct - package

        • string "name" - packageName

        • string "arch" - archLabel - optional

    • boolean "universal_default"

    • boolean "disabled"

    • string "contact_method" - One of the following:

    • default

    • ssh-push

    • ssh-push-tunnel

Available since API version: 10.2

Method: listActivatedSystems

Description:

List the systems activated with the key provided.

Parameters:

  • string sessionKey

  • string key

Returns:

  • array :

    • struct - system structure

      • int "id" - System id

      • string "hostname"

      • dateTime.iso8601 "last_checkin" - Last time server successfully checked in

Method: listActivationKeys

Description:

List activation keys that are visible to the user.

Parameters:

  • string sessionKey

Returns:

  • array :

  • struct - activation key

    • string "key"

    • string "description"

    • int "usage_limit"

    • string "base_channel_label"

    • array "child_channel_labels"

      • string - childChannelLabel

    • array "entitlements"

      • string - entitlementLabel

    • array "server_group_ids"

      • string - serverGroupId

    • array "package_names"

      • string - packageName - (deprecated by packages)

    • array "packages"

      • struct - package

        • string "name" - packageName

        • string "arch" - archLabel - optional

    • boolean "universal_default"

    • boolean "disabled"

    • string "contact_method" - One of the following:

    • default

    • ssh-push

    • ssh-push-tunnel

Available since API version: 10.2

Method: listChannels

Description:

List the channels for the given activation key with temporary authentication tokens to access them. Authentication is done via a machine specific password.

Parameters:

  • string minionId - The id of the minion to authenticate with.

  • string machinePassword - password specific to a machine.

  • string activationKey - activation key to use channels from.

Returns:

  • array :

  • struct - channelInfo

    • string "label" - Channel label

    • string "name" - Channel name

    • string "url" - Channel url

    • string "token" - Channel access token

Method: listConfigChannels

Description:

List configuration channels associated to an activation key.

Parameters:

  • string sessionKey

  • string key

Returns:

  • array :

  • struct - Configuration Channel information

    • int "id"

    • int "orgId"

    • string "label"

    • string "name"

    • string "description"

    • struct "configChannelType"

  • struct - Configuration Channel Type information

    • int "id"

    • string "label"

    • string "name"

    • int "priority"

Method: removeChildChannels

Description:

Remove child channels from an activation key.

Parameters:

  • string sessionKey

  • string key

  • array :

    • string - childChannelLabel

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: removeConfigChannels

Description:

Remove configuration channels from the given activation keys.

Parameters:

  • string sessionKey

  • array :

    • string - activationKey

  • array :

    • string - configChannelLabel

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: removeEntitlements

Description:

Remove entitlements (by label) from an activation key. Currently only virtualization_host add-on entitlement is permitted.

Parameters:

  • string sessionKey

  • string key

  • array string - entitlement label

    • virtualization_host

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: removePackageNames (Deprecated)

Description:

Remove package names from an activation key.

Deprecated - being replaced by removePackages(string sessionKey, string key, array[packages])

Parameters:

  • string sessionKey

  • string key

  • array :

    • string - packageName

Returns:

  • int - 1 on success, exception thrown otherwise.

Available since API version: 10.2

Method: removePackages

Description:

Remove package names from an activation key.

Parameters:

  • string sessionKey

  • string key

  • array :

    • struct - packages

      • string "name" - Package name

      • string "arch" - Arch label - Optional

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: removeServerGroups

Description:

Remove server groups from an activation key.

Parameters:

  • string sessionKey

  • string key

  • array :

    • int - serverGroupId

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: setConfigChannels

Description:

Replace the existing set of configuration channels on the given activation keys. Channels are ranked by their order in the array.

Parameters:

  • string sessionKey

  • array :

    • string - activationKey

  • array :

    • string - configChannelLabel

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: setDetails

Description:

Update the details of an activation key.

Parameters:

  • string sessionKey

  • string key

  • struct - activation key

    • string "description" - optional

    • string "base_channel_label" - optional - to set default base channel set to empty string or 'none'

    • int "usage_limit" - optional

    • boolean "unlimited_usage_limit" - Set true for unlimited usage and to override usage_limit

    • boolean "universal_default" - optional

    • boolean "disabled" - optional

    • string "contact_method" - One of the following:

    • default

    • ssh-push

    • ssh-push-tunnel

Returns:

  • int - 1 on success, exception thrown otherwise.