Skip to content

Commit ec85dcb

Browse files
feat: add new account management v4 api
Signed-off-by: David <David.Lim0305@ibm.com>
1 parent 6c51231 commit ec85dcb

5 files changed

Lines changed: 813 additions & 21 deletions

File tree

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,29 @@ Python client library to interact with various
4444
The IBM Cloud Platform Services Python SDK allows developers to programmatically interact with the following
4545
IBM Cloud services:
4646

47-
Service Name | Module Name | Service Class Name
48-
--- | --- | ---
49-
[Case Management](https://cloud.ibm.com/apidocs/case-management?code=python) | case_management_v1 | CaseManagementV1
50-
[Catalog Management](https://cloud.ibm.com/apidocs/resource-catalog/private-catalog?code=python) | catalog_management_v1 | CatalogManagementV1
47+
Service Name | Module Name | Service Class Name
48+
--- |-------------------------------| ---
49+
[Account Management](https://test.cloud.ibm.com/apidocs/account-management) | account_management_v4 | AccountManagementV4
50+
[Case Management](https://cloud.ibm.com/apidocs/case-management?code=python) | case_management_v1 | CaseManagementV1
51+
[Catalog Management](https://cloud.ibm.com/apidocs/resource-catalog/private-catalog?code=python) | catalog_management_v1 | CatalogManagementV1
5152
[Context Based Restrictions](https://cloud.ibm.com/apidocs/context-based-restrictions?code=python) | context_based_restrictions_v1 | ContextBasedRestrictionsV1
52-
[Enterprise Billing Units](https://cloud.ibm.com/apidocs/enterprise-apis/billing-unit?code=python) | enterprise_billing_units_v1 | EnterpriseBillingUnitsV1
53-
[Enterprise Management](https://cloud.ibm.com/apidocs/enterprise-apis/enterprise?code=python) | enterprise_management_v1 | EnterpriseManagementV1
54-
[Enterprise Usage Reports](https://cloud.ibm.com/apidocs/enterprise-apis/resource-usage-reports?code=python) | enterprise_usage_reports_v1 | EnterpriseUsageReportsV1
55-
[Global Catalog](https://cloud.ibm.com/apidocs/resource-catalog/global-catalog?code=python) | global_catalog_v1 | GlobalCatalogV1
56-
[Global Search](https://cloud.ibm.com/apidocs/search?code=python) | global_search_v2 | GlobalSearchV2
57-
[Global Tagging](https://cloud.ibm.com/apidocs/tagging?code=python) | global_tagging_v1 | GlobalTaggingV1
58-
[IAM Access Groups](https://cloud.ibm.com/apidocs/iam-access-groups?code=python) | iam_access_groups_v2 | IamAccessGroupsV2
59-
[IAM Identity Service](https://cloud.ibm.com/apidocs/iam-identity-token-api?code=python) | iam_identity_v1 | IamIdentityV1
60-
[IAM Policy Management](https://cloud.ibm.com/apidocs/iam-policy-management?code=python) | iam_policy_management_v1 | IamPolicyManagementV1
61-
[IBM Cloud Shell](https://cloud.ibm.com/apidocs/cloudshell?code=python) | ibm_cloud_shell_v1 | IbmCloudShellV1
62-
[Open Service Broker](https://cloud.ibm.com/apidocs/resource-controller/ibm-cloud-osb-api?code=python) | open_service_broker_v1 | OpenServiceBrokerV1
63-
[Partner Management APIs](https://cloud.ibm.com/apidocs/partner-apis/partner?code=python) | partner_management_v1 | PartnerManagementV1
64-
[Resource Controller](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=python) | resource_controller_v2 | ResourceControllerV2
65-
[Resource Manager](https://cloud.ibm.com/apidocs/resource-controller/resource-manager?code=python) | resource_manager_v2 | ResourceManagerV2
66-
[Usage Metering](https://cloud.ibm.com/apidocs/usage-metering?code=python) | usage_metering_v4 | UsageMeteringV4
67-
[Usage Reports](https://cloud.ibm.com/apidocs/metering-reporting?code=python) | usage_reports_v4 | UsageReportsV4
68-
[User Management](https://cloud.ibm.com/apidocs/user-management?code=python) | user_management_v1 | UserManagementV1
53+
[Enterprise Billing Units](https://cloud.ibm.com/apidocs/enterprise-apis/billing-unit?code=python) | enterprise_billing_units_v1 | EnterpriseBillingUnitsV1
54+
[Enterprise Management](https://cloud.ibm.com/apidocs/enterprise-apis/enterprise?code=python) | enterprise_management_v1 | EnterpriseManagementV1
55+
[Enterprise Usage Reports](https://cloud.ibm.com/apidocs/enterprise-apis/resource-usage-reports?code=python) | enterprise_usage_reports_v1 | EnterpriseUsageReportsV1
56+
[Global Catalog](https://cloud.ibm.com/apidocs/resource-catalog/global-catalog?code=python) | global_catalog_v1 | GlobalCatalogV1
57+
[Global Search](https://cloud.ibm.com/apidocs/search?code=python) | global_search_v2 | GlobalSearchV2
58+
[Global Tagging](https://cloud.ibm.com/apidocs/tagging?code=python) | global_tagging_v1 | GlobalTaggingV1
59+
[IAM Access Groups](https://cloud.ibm.com/apidocs/iam-access-groups?code=python) | iam_access_groups_v2 | IamAccessGroupsV2
60+
[IAM Identity Service](https://cloud.ibm.com/apidocs/iam-identity-token-api?code=python) | iam_identity_v1 | IamIdentityV1
61+
[IAM Policy Management](https://cloud.ibm.com/apidocs/iam-policy-management?code=python) | iam_policy_management_v1 | IamPolicyManagementV1
62+
[IBM Cloud Shell](https://cloud.ibm.com/apidocs/cloudshell?code=python) | ibm_cloud_shell_v1 | IbmCloudShellV1
63+
[Open Service Broker](https://cloud.ibm.com/apidocs/resource-controller/ibm-cloud-osb-api?code=python) | open_service_broker_v1 | OpenServiceBrokerV1
64+
[Partner Management APIs](https://cloud.ibm.com/apidocs/partner-apis/partner?code=python) | partner_management_v1 | PartnerManagementV1
65+
[Resource Controller](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=python) | resource_controller_v2 | ResourceControllerV2
66+
[Resource Manager](https://cloud.ibm.com/apidocs/resource-controller/resource-manager?code=python) | resource_manager_v2 | ResourceManagerV2
67+
[Usage Metering](https://cloud.ibm.com/apidocs/usage-metering?code=python) | usage_metering_v4 | UsageMeteringV4
68+
[Usage Reports](https://cloud.ibm.com/apidocs/metering-reporting?code=python) | usage_reports_v4 | UsageReportsV4
69+
[User Management](https://cloud.ibm.com/apidocs/user-management?code=python) | user_management_v1 | UserManagementV1
6970

7071
The following services have been relocated to a different SDK project.
7172
Please consult the documentation for each service to determine the new location:
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# -*- coding: utf-8 -*-
2+
# (C) Copyright IBM Corp. 2026.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
"""
17+
Examples for AccountManagementV4
18+
"""
19+
20+
from ibm_cloud_sdk_core import ApiException, read_external_sources
21+
import os
22+
import pytest
23+
from ibm_platform_services.account_management_v4 import *
24+
25+
#
26+
# This file provides an example of how to use the account_management service.
27+
#
28+
# The following configuration properties are assumed to be defined:
29+
# ACCOUNT_MANAGEMENT_URL=<service base url>
30+
# ACCOUNT_MANAGEMENT_AUTH_TYPE=iam
31+
# ACCOUNT_MANAGEMENT_APIKEY=<IAM apikey>
32+
# ACCOUNT_MANAGEMENT_AUTH_URL=<IAM token service base URL - omit this if using the production environment>
33+
# ACCOUNT_MANAGEMENT_ACCOUNT_ID=<account id>
34+
#
35+
# These configuration properties can be exported as environment variables, or stored
36+
# in a configuration file and then:
37+
# export IBM_CREDENTIALS_FILE=<name of configuration file>
38+
#
39+
config_file = 'account_management_v4.env'
40+
41+
account_management_service = None
42+
43+
config = None
44+
45+
account_id = None
46+
47+
48+
##############################################################################
49+
# Start of Examples for Service: AccountManagementV4
50+
##############################################################################
51+
# region
52+
class TestAccountManagementV4Examples:
53+
"""
54+
Example Test Class for AccountManagementV4
55+
"""
56+
57+
@classmethod
58+
def setup_class(cls):
59+
global account_management_service
60+
if os.path.exists(config_file):
61+
os.environ['IBM_CREDENTIALS_FILE'] = config_file
62+
63+
# begin-common
64+
65+
account_management_service = AccountManagementV4.new_instance()
66+
67+
# end-common
68+
assert account_management_service is not None
69+
70+
# Load the configuration
71+
global config
72+
config = read_external_sources(AccountManagementV4.DEFAULT_SERVICE_NAME)
73+
global account_id
74+
account_id = config['ACCOUNT_ID']
75+
print('Setup complete.')
76+
77+
needscredentials = pytest.mark.skipif(
78+
not os.path.exists(config_file), reason="External configuration not available, skipping..."
79+
)
80+
81+
@needscredentials
82+
def test_get_account_example(self):
83+
"""
84+
get_account request example
85+
"""
86+
try:
87+
print('\nget_account() result:')
88+
89+
# begin-getAccount
90+
91+
response = account_management_service.get_account(
92+
account_id=account_id,
93+
)
94+
account_response = response.get_result()
95+
96+
print(json.dumps(account_response, indent=2))
97+
98+
# end-getAccount
99+
100+
except ApiException as e:
101+
pytest.fail(str(e))
102+
103+
104+
# endregion
105+
##############################################################################
106+
# End of Examples for Service: AccountManagementV4
107+
##############################################################################

0 commit comments

Comments
 (0)