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 1818create_serviceaccount_payload = CreateServiceAccountPayload (
1919 name = "my-service-account" ,
2020)
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 44from stackit .core .configuration import Configuration
55
66project_id = os .getenv ("PROJECT_ID" )
7+ account_mail = "SERVICE_ACCOUNT_MAIL"
78
89# Create a new API client, that uses default authentication and configuration
910config = Configuration ()
1011client = DefaultApi (config )
1112
12- # List all serviceaccounts
13- response = client .list_service_accounts (project_id )
1413
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 1919 name = "my-instance" ,
2020 flavorId = flavor_response .flavors [0 ].id ,
2121)
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 44from stackit .core .configuration import Configuration
55
66project_id = os .getenv ("PROJECT_ID" )
7+ instance_id = "INSTANCE_ID"
78
89# Create a new API client, that uses default authentication and configuration
910config = Configuration ()
1011client = DefaultApi (config )
1112
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