Skip to content

Commit 7c0b4d4

Browse files
authored
Adding termid parameter for conflent org creation (#9091)
* Adding termid parameter * Updates to change log version * Added help for term_id parameter * Added Live tests recording and updated the api version * Moved the term id to constants file * Remove blank line for fixing azdev style issue * Fix azdev style issue * added 2 blank lines as per the azdev style * Fix assertion error by changing email to test@example.com
1 parent 2fe0582 commit 7c0b4d4

16 files changed

+4172
-1359
lines changed

src/confluent/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
Release History
44
===============
5+
1.1.0
6+
+++++
7+
* Updated az confluent organization create command to accept term_id as an optional parameter.
8+
59
1.0.0
610
+++++
711
* Updated CLI command descriptions to be more user and support az mcp commands.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
6+
# Confluent constants
7+
8+
DEFAULT_TERM_ID = "gmz7xq9ge3py" # Replace with the actual default value if known

src/confluent/azext_confluent/manual/_params.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def load_arguments(self, _):
1717
c.argument('plan_id', type=str, help='Offer Plan Id', arg_group='Offer Detail')
1818
c.argument('plan_name', type=str, help='Offer Plan Name', arg_group='Offer Detail')
1919
c.argument('term_unit', type=str, help='Offer Plan Term unit', arg_group='Offer Detail')
20+
c.argument('term_id', type=str, help='Offer Plan Term ID', arg_group='Offer Detail')
2021

2122
with self.argument_context('confluent organization delete') as c:
2223
c.argument('yes', options_list=['--yes', '-y'], action='store_true', help='Do not prompt for confirmation.')

src/confluent/azext_confluent/manual/custom.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# --------------------------------------------------------------------------
1010

1111
from azure.cli.core.util import sdk_no_wait, user_confirmation
12+
from ..constants import DEFAULT_TERM_ID
1213

1314

1415
def confluent_organization_create(cmd,
@@ -18,6 +19,7 @@ def confluent_organization_create(cmd,
1819
plan_id,
1920
plan_name,
2021
term_unit,
22+
term_id=None,
2123
tags=None,
2224
location=None,
2325
publisher_id=None,
@@ -61,7 +63,7 @@ def confluent_organization_create(cmd,
6163
body['offer_detail']['plan_id'] = plan_id
6264
body['offer_detail']['plan_name'] = plan_name
6365
body['offer_detail']['term_unit'] = term_unit
64-
66+
body['offer_detail']['term_id'] = DEFAULT_TERM_ID if term_id is None else term_id
6567
return sdk_no_wait(no_wait,
6668
client.begin_create,
6769
resource_group_name=resource_group_name,

src/confluent/azext_confluent/tests/latest/recordings/test_confluent_Scenario.yaml

Lines changed: 2444 additions & 735 deletions
Large diffs are not rendered by default.

src/confluent/azext_confluent/tests/latest/recordings/test_term_accept_basic_flow.yaml

Lines changed: 1681 additions & 597 deletions
Large diffs are not rendered by default.

src/confluent/azext_confluent/tests/latest/test_confluent_scenario.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,18 @@ def call_scenario(test, rg):
122122
step_organization_create(test, rg, checks=[
123123
test.check("location", "eastus2euap", case_sensitive=False),
124124
# change to real values for userDetail in live tests
125-
test.check("userDetail.emailAddress", "contoso@microsoft.com", case_sensitive=False),
126-
test.check("userDetail.firstName", "contoso", case_sensitive=False),
127-
test.check("userDetail.lastName", "zhou", case_sensitive=False),
125+
test.check("userDetail.emailAddress", "test@example.com", case_sensitive=False),
126+
test.check("userDetail.firstName", "Deepika", case_sensitive=False),
127+
test.check("userDetail.lastName", "N", case_sensitive=False),
128128
test.check("tags.environment", "Dev", case_sensitive=False),
129129
test.check("name", "{myOrganization}", case_sensitive=False),
130130
])
131131
step_organization_show(test, rg, checks=[
132132
test.check("location", "eastus2euap", case_sensitive=False),
133133
# change to real values for userDetail in live tests
134-
test.check("userDetail.emailAddress", "contoso@microsoft.com", case_sensitive=False),
135-
test.check("userDetail.firstName", "contoso", case_sensitive=False),
136-
test.check("userDetail.lastName", "zhou", case_sensitive=False),
134+
test.check("userDetail.emailAddress", "test@example.com", case_sensitive=False),
135+
test.check("userDetail.firstName", "Deepika", case_sensitive=False),
136+
test.check("userDetail.lastName", "N", case_sensitive=False),
137137
test.check("tags.environment", "Dev", case_sensitive=False),
138138
test.check("name", "{myOrganization}", case_sensitive=False),
139139
])
@@ -145,9 +145,9 @@ def call_scenario(test, rg):
145145
])
146146
step_organization_update(test, rg, checks=[
147147
test.check("location", "eastus2euap", case_sensitive=False),
148-
test.check("userDetail.emailAddress", "contoso@microsoft.com", case_sensitive=False),
149-
test.check("userDetail.firstName", "contoso", case_sensitive=False),
150-
test.check("userDetail.lastName", "zhou", case_sensitive=False),
148+
test.check("userDetail.emailAddress", "test@example.com", case_sensitive=False),
149+
test.check("userDetail.firstName", "Deepika", case_sensitive=False),
150+
test.check("userDetail.lastName", "N", case_sensitive=False),
151151
test.check("name", "{myOrganization}", case_sensitive=False),
152152
test.check("tags.client", "dev-client", case_sensitive=False),
153153
])
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|
2-
|step_terms_list|successed||||2025-06-05 05:20:39.201743|2025-06-05 05:20:39.676841|
3-
|step_organization_show|successed||||2025-06-05 05:20:40.372454|2025-06-05 05:20:40.590599|
4-
|step_organization_list|successed||||2025-06-05 05:20:40.590599|2025-06-05 05:20:40.827538|
5-
|step_organization_list2|successed||||2025-06-05 05:20:40.828541|2025-06-05 05:20:41.034481|
6-
|step_organization_update|successed||||2025-06-05 05:20:41.036496|2025-06-05 05:20:41.235630|
7-
|step_organization_delete|successed||||2025-06-05 05:20:41.235630|2025-06-05 05:20:41.628799|
2+
|step_terms_list|successed||||2025-08-28 08:06:16.102233|2025-08-28 08:06:17.474145|
3+
|step_organization_show|successed||||2025-08-28 08:07:42.460262|2025-08-28 08:07:43.541080|
4+
|step_organization_list|successed||||2025-08-28 08:07:43.541080|2025-08-28 08:07:44.422305|
5+
|step_organization_list2|successed||||2025-08-28 08:07:44.423313|2025-08-28 08:07:47.132562|
6+
|step_organization_update|successed||||2025-08-28 08:07:47.132562|2025-08-28 08:07:52.996682|
7+
|step_organization_delete|successed||||2025-08-28 08:07:52.997698|2025-08-28 08:08:30.250520|
88
Coverage: 6/6

src/confluent/azext_confluent/vendored_sdks/confluent/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
51-
self.api_version = "2021-03-01-preview"
51+
self.api_version = "2024-07-01"
5252
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5353
kwargs.setdefault('sdk_moniker', 'mgmt-confluent/{}'.format(VERSION))
5454
self._configure(**kwargs)

src/confluent/azext_confluent/vendored_sdks/confluent/models/_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ class OfferDetail(msrest.serialization.Model):
181181
'plan_id': {'key': 'planId', 'type': 'str'},
182182
'plan_name': {'key': 'planName', 'type': 'str'},
183183
'term_unit': {'key': 'termUnit', 'type': 'str'},
184+
'term_id': {'key': 'termId', 'type': 'str'},
184185
'status': {'key': 'status', 'type': 'str'},
185186
}
186187

@@ -194,6 +195,7 @@ def __init__(
194195
self.plan_id = kwargs['plan_id']
195196
self.plan_name = kwargs['plan_name']
196197
self.term_unit = kwargs['term_unit']
198+
self.term_id = kwargs['term_id']
197199
self.status = kwargs.get('status', None)
198200

199201

0 commit comments

Comments
 (0)