Skip to content

Commit 10b8168

Browse files
authored
fix (#9022)
1 parent 33765bf commit 10b8168

File tree

5 files changed

+40985
-1
lines changed

5 files changed

+40985
-1
lines changed

src/containerapp/HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Release History
44
===============
55
upcoming
66
++++++
7+
8+
1.2.0b3
9+
++++++
10+
* 'az containerapp job list': Fix only 20 items returned
11+
12+
1.2.0b2
13+
++++++
714
* 'az containerapp session code-interpreter execute': Extend maximum supported value of `--timeout-in-seconds` from 60 to 220.
815
* 'az containerapp job create': Fix message with `--help`
916
* 'az containerapp arc': Enable setup custom core dns for Openshift on Arc

src/containerapp/azext_containerapp/_clients.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,62 @@ def get_auth_token(cls, cmd, resource_group_name, name):
120120
r = send_raw_request(cmd.cli_ctx, "POST", request_url)
121121
return r.json()
122122

123+
@classmethod
124+
def list_by_subscription(cls, cmd, formatter=lambda x: x):
125+
app_list = []
126+
127+
management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
128+
sub_id = get_subscription_id(cmd.cli_ctx)
129+
request_url = "{}/subscriptions/{}/providers/Microsoft.App/jobs?api-version={}".format(
130+
management_hostname.strip('/'),
131+
sub_id,
132+
cls.api_version)
133+
134+
r = send_raw_request(cmd.cli_ctx, "GET", request_url)
135+
j = r.json()
136+
for app in j["value"]:
137+
formatted = formatter(app)
138+
app_list.append(formatted)
139+
140+
while j.get("nextLink") is not None:
141+
request_url = j["nextLink"]
142+
r = send_raw_request(cmd.cli_ctx, "GET", request_url)
143+
j = r.json()
144+
for app in j["value"]:
145+
formatted = formatter(app)
146+
app_list.append(formatted)
147+
148+
return app_list
149+
150+
@classmethod
151+
def list_by_resource_group(cls, cmd, resource_group_name, formatter=lambda x: x):
152+
app_list = []
153+
154+
management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
155+
sub_id = get_subscription_id(cmd.cli_ctx)
156+
url_fmt = "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs?api-version={}"
157+
request_url = url_fmt.format(
158+
management_hostname.strip('/'),
159+
sub_id,
160+
resource_group_name,
161+
cls.api_version)
162+
163+
r = send_raw_request(cmd.cli_ctx, "GET", request_url)
164+
j = r.json()
165+
for app in j["value"]:
166+
formatted = formatter(app)
167+
app_list.append(formatted)
168+
169+
while j.get("nextLink") is not None:
170+
request_url = j["nextLink"]
171+
r = send_raw_request(cmd.cli_ctx, "GET", request_url)
172+
j = r.json()
173+
for app in j["value"]:
174+
formatted = formatter(app)
175+
app_list.append(formatted)
176+
177+
return app_list
178+
123179

124180
class ContainerAppsResiliencyPreviewClient():
125181
api_version = PREVIEW_API_VERSION

0 commit comments

Comments
 (0)