sap.sap_operations.btp_subaccount module – Manage SAP BTP global account subaccounts

Note

This module is part of the sap.sap_operations collection.

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install sap.sap_operations. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: sap.sap_operations.btp_subaccount.

New in sap.sap_operations 1.27.0

Synopsis

  • It is not yet possible to remove existing subaccount with this plugin

  • Subaccount will not be updated if there is already subaccount with same subdomain.

  • This action plugin is using SAP BTP API, see <api.sap.com> for more details.

  • This is ansible action plugin, this means it will run on ansible controller, not on managed node.

  • This module allows managing SAP BTP global account subaccounts, including creation and information retrieval.

  • This plugin does not support running with python 2. It requires python 3.6 or higher.

Note

This module has a corresponding action plugin.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.6

  • requests

  • oauth2_client

Parameters

Parameter

Comments

api_endpoint

string / required

API endpoint to use. For example https://api.cf.eu10.hana.ondemand.com

authorize_service_url

string / required

URL of the authorization service.

beta_enabled

boolean

Specifies if the subaccount should have beta features enabled.

Choices:

  • false

  • true ← (default)

client_id

string / required

Client ID to use for authentication.

client_secret

string / required

Client secret to use for authentication.

description

string / required

Description of the subaccount to be created or managed.

display_name

string / required

The display name for the subaccount.

login

string / required

Login to use for authentication. This is usually an email address.

password

string / required

Password to use for authentication.

region

string / required

The region where the subaccount will be created.

subaccount_admins

list / elements=string / required

A list of emails for the subaccount administrators.

subdomain

string / required

The subdomain for the subaccount

Should be globally unique

token_service_url

string / required

URL of the token service.

Notes

Note

  • This module is community supported

  • Module interface (parameters, output) expected to be stable but not guaranteed

  • Module planned to be released on Ansible Automation Hub after collecting some feedback

  • There is no guarantee that this module will be officially supported by Red Hat

  • This is ansible action plugin, not module

  • Meaning this plugin will be always executed on ansible controller.

See Also

See also

SAP BTP API Accounts service API

SAP BTP API Accounts service API

Administration and operations section for SAP BTP on help.sap.com

Administration and operations section for SAP BTP on help.sap.com

Examples

---
- name: Create a new subaccount in SAP BTP
  sap.sap_operations.btp_subaccount:
    description: "Development environment"
    beta_enabled: true
    display_name: "Dev Environment"
    region: "eu10"
    subaccount_admins:
      - "admin@example.com"
    subdomain: "dev-env"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

btp_subaccount

dictionary

The result of the Ansible plugin operation, containing details about the subaccount.

Returned: success

Sample: {"betaEnabled": true, "contentAutomationState": null, "contentAutomationStateDetails": null, "createdBy": null, "createdDate": 1713452527495, "description": "Subaccount managed by ansible", "displayName": "ansible-subaccount-1775088641", "globalAccountGUID": "7hbf5926-fh9a-4b7e-9b5a-cf3hls6s7", "guid": "42fss8ec-r75b-4n0l-b5;e-c8b40dd9d839", "modifiedDate": 1713452550559, "parentGUID": "7hbf5926-4hda-4b7e-9b5a-cfl8ls6s7", "parentType": "ROOT", "region": "us10", "state": "OK", "stateMessage": "Subaccount created.", "subdomain": "ansible-subdomain-1775088641", "technicalName": "42fss8ec-r75b-4n0l-b5;e-c8b40dd9d839", "usedForProduction": "USED_FOR_PRODUCTION"}

betaEnabled

boolean

Indicates if the beta features are enabled for the subaccount.

Returned: always

contentAutomationState

string

The state of content automation for the subaccount, if applicable.

Returned: when applicable

createdBy

string

The identifier of the user who created the subaccount.

Returned: when available

createdDate

string

The timestamp when the subaccount was created.

Returned: always

description

string

A brief description of the subaccount.

Returned: always

displayName

string

The display name of the subaccount.

Returned: always

globalAccountGUID

string

The GUID of the global account to which the subaccount belongs.

Returned: always

guid

string

The unique identifier of the subaccount.

Returned: always

modifiedDate

string

The timestamp when the subaccount was last modified.

Returned: always

parentGUID

string

The GUID of the parent account.

Returned: always

parentType

string

The type of the parent account.

Returned: always

region

string

The region in which the subaccount is located.

Returned: always

state

string

The current state of the subaccount.

Returned: always

stateMessage

string

A message providing additional details about the state of the subaccount.

Returned: always

subdomain

string

The subdomain assigned to the subaccount.

Returned: always

technicalName

string

The technical name of the subaccount.

Returned: always

usedForProduction

string

Indicates whether the subaccount is used for production purposes.

Returned: always

Authors

  • Kirill Satarin (@kksat)