sap.sap_operations.btp_global_account_info module – Get information about a SAP BTP global account.

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_global_account_info.

New in sap.sap_operations 1.26.0

Synopsis

  • Get information about a SAP BTP global account.

  • 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 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.

client_id

string / required

Client ID to use for authentication.

client_secret

string / required

Client secret to use for authentication.

expand

boolean

Expand the response with additional information.

Choices:

  • false

  • true ← (default)

login

string / required

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

password

string / required

Password to use for authentication.

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: Get SAP BTP global account information
  sap.sap_operations.btp_global_account_info:
    login: username@host.com
    password: SecretPassword ## not secret
    api_endpoint: https://accounts-service.cfapps.eu10.hana.ondemand.com
    client_id: "{{ lookup('env', 'BTP_CLIENT_ID') }}"
    client_secret: "{{ lookup('env', 'BTP_CLIENT_SECRET') }}"
    authorize_service_url: 'https://accounts-service.cfapps.eu10.hana.ondemand.com/oauth/authorize'
    token_service_url: 'https://example-global-account.authentication.eu10.hana.ondemand.com/oauth/token'
    expand: true

Return Values

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

Key

Description

btp_global_account_info

dictionary

Dictionary with SAP BTP global account information.

Returned: success

Sample: {"commercialModel": "Subscription", "consumptionBased": false, "contractStatus": "ACTIVE", "createdDate": 1701277726166, "displayName": "Trial global account", "entityState": "OK", "geoAccess": "STANDARD", "guid": "32864b5f-guid-guid-guid-eb27a837c2f2", "licenseType": "TRIAL", "modifiedDate": 1704803656733, "renewalDate": 1706461726145, "stateMessage": "Global account created.", "subdomain": "subdomaintrial-ga"}

children

list / elements=dictionary

List with SAP BTP global account directories [Feature Set B]

Returned: only if the are subdirectories in the global directory

Sample: [{"consumptionBased": false, "contractStatus": "ACTIVE", "createdBy": "username@host.com", "createdDate": 1705414050315, "directoryFeatures": ["DEFAULT"], "directoryType": "FOLDER", "displayName": "test", "entityState": "OK", "globalAccountGUID": "32864b5f-guid-guid-guid-eb27a837c2f2", "guid": "4c71c790-guid-guid-guid-b56c6754f8e4", "modifiedDate": 1705414050315, "parentGUID": "32864b5f-guid-guid-guid-eb27a837c2f2", "parentGuid": "32864b5f-guid-guid-guid-eb27a837c2f2", "parentType": "ROOT", "stateMessage": "Directory created.", "subaccounts": [{"betaEnabled": false, "contentAutomationState": null, "contentAutomationStateDetails": null, "createdBy": "username@host.com", "createdDate": 1705414070346, "description": null, "displayName": "test", "globalAccountGUID": "32864b5f-guid-guid-guid-eb27a837c2f2", "guid": "eb4aac50-guid-guid-guid-a3364d6b6c16", "modifiedDate": 1705414085650, "parentFeatures": ["DEFAULT"], "parentGUID": "4c71c790-guid-guid-guid-b56c6754f8e4", "parentType": "FOLDER", "region": "us10", "sapManagedType": null, "state": "OK", "stateMessage": "Subaccount created.", "subdomain": "test-subdomain", "technicalName": "eb4aac50-guid-guid-guid-a3364d6b6c16", "usedForProduction": "UNSET"}]}]

commercialModel

string

The commercial model of the account.

Returned: always

Sample: "Subscription"

consumptionBased

boolean

Indicates if the account is consumption based.

Returned: always

Sample: false

contractStatus

string

The status of the account contract.

Returned: always

Sample: "ACTIVE"

createdDate

integer

The timestamp when the account was created.

Returned: always

Sample: 1710931123147

displayName

string

The display name of the account.

Returned: always

Sample: "470ae534trial"

entityState

string

The state of the account entity.

Returned: always

Sample: "OK"

geoAccess

string

The geographical access level of the account.

Returned: always

Sample: "STANDARD"

guid

string

The globally unique identifier of the account.

Returned: always

Sample: "7abf6926-f5da-467e-975a-cf2473680127"

licenseType

string

The type of license the account holds.

Returned: always

Sample: "TRIAL"

modifiedDate

integer

The timestamp when the account was last modified.

Returned: always

Sample: 1711622755495

renewalDate

integer

The timestamp when the account is due for renewal.

Returned: always

Sample: 1713523123127

stateMessage

string

A message describing the state of the account.

Returned: always

Sample: "Global account created."

subaccounts

list / elements=dictionary

A list of subaccounts associated with the account.

Returned: always

betaEnabled

boolean

Indicates if beta features are enabled for the subaccount.

Returned: always

Sample: false

createdDate

integer

The timestamp when the subaccount was created.

Returned: always

Sample: 1710931140438

displayName

string

The display name of the subaccount.

Returned: always

Sample: "trial"

globalAccountGUID

string

The globally unique identifier for the parent account.

Returned: always

Sample: "7abd69g6-f5dg-46fe-975a-cf2473680127"

guid

string

globally unique identifier for the subaccount.

Returned: always

Sample: "4et23db7-bb09-40da-938c-a17e98ea4ce"

region

string

The region where the subaccount is located.

Returned: always

Sample: "us10"

state

string

The state of the subaccount.

Returned: always

Sample: "OK"

subdomain

string

The subdomain assigned to the subaccount.

Returned: always

Sample: "470ae534trial"

subdomain

string

The subdomain assigned to the global account.

Returned: always

Sample: "470ae534trial-ga"

Authors

  • Kirill Satarin (@kksat)