File tree Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 18
18
create_serviceaccount_payload = CreateServiceAccountPayload (
19
19
name = "my-service-account" ,
20
20
)
21
- client .create_service_account (project_id , create_serviceaccount_payload )
21
+ sa = client .create_service_account (project_id , create_serviceaccount_payload )
22
+ print (f"Created service-account with email { sa .email } " )
Original file line number Diff line number Diff line change 4
4
from stackit .core .configuration import Configuration
5
5
6
6
project_id = os .getenv ("PROJECT_ID" )
7
+ account_mail = "SERVICE_ACCOUNT_MAIL"
7
8
8
9
# Create a new API client, that uses default authentication and configuration
9
10
config = Configuration ()
10
11
client = DefaultApi (config )
11
12
12
- # List all serviceaccounts
13
- response = client .list_service_accounts (project_id )
14
13
15
- # Delete all accounts
16
- for account in response .items :
17
- client .delete_service_account (project_id , account .email )
14
+ # Delete service account
15
+ client .delete_service_account (project_id , account_mail )
Original file line number Diff line number Diff line change 19
19
name = "my-instance" ,
20
20
flavorId = flavor_response .flavors [0 ].id ,
21
21
)
22
- client .create_instance (project_id , create_instance_payload )
22
+ instance = client .create_instance (project_id , create_instance_payload )
23
+
24
+ print (f"Created instance with ID: { instance .id } " )
Original file line number Diff line number Diff line change 4
4
from stackit .core .configuration import Configuration
5
5
6
6
project_id = os .getenv ("PROJECT_ID" )
7
+ instance_id = "INSTANCE_ID"
7
8
8
9
# Create a new API client, that uses default authentication and configuration
9
10
config = Configuration ()
10
11
client = DefaultApi (config )
11
12
12
- # List all sqlserverflex instances
13
- response = client .list_instances (project_id )
14
-
15
- # Delete all instances
16
- for instance in response .items :
17
- client .delete_instance (project_id , instance .id )
13
+ # Delete the instance
14
+ client .delete_instance (project_id , instance_id )
You can’t perform that action at this time.
0 commit comments