Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Release History
===============
upcoming
++++++

1.2.0b3
++++++
* 'az containerapp job list': Fix only 20 items returned

1.2.0b2
++++++
* 'az containerapp session code-interpreter execute': Extend maximum supported value of `--timeout-in-seconds` from 60 to 220.
* 'az containerapp job create': Fix message with `--help`
* 'az containerapp arc': Enable setup custom core dns for Openshift on Arc
Expand Down
56 changes: 56 additions & 0 deletions src/containerapp/azext_containerapp/_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,62 @@ def get_auth_token(cls, cmd, resource_group_name, name):
r = send_raw_request(cmd.cli_ctx, "POST", request_url)
return r.json()

@classmethod
def list_by_subscription(cls, cmd, formatter=lambda x: x):
app_list = []

management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
sub_id = get_subscription_id(cmd.cli_ctx)
request_url = "{}/subscriptions/{}/providers/Microsoft.App/jobs?api-version={}".format(
management_hostname.strip('/'),
sub_id,
cls.api_version)

r = send_raw_request(cmd.cli_ctx, "GET", request_url)
j = r.json()
for app in j["value"]:
formatted = formatter(app)
app_list.append(formatted)

while j.get("nextLink") is not None:
request_url = j["nextLink"]
r = send_raw_request(cmd.cli_ctx, "GET", request_url)
j = r.json()
for app in j["value"]:
formatted = formatter(app)
app_list.append(formatted)

return app_list

@classmethod
def list_by_resource_group(cls, cmd, resource_group_name, formatter=lambda x: x):
app_list = []

management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
sub_id = get_subscription_id(cmd.cli_ctx)
url_fmt = "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs?api-version={}"
request_url = url_fmt.format(
management_hostname.strip('/'),
sub_id,
resource_group_name,
cls.api_version)

r = send_raw_request(cmd.cli_ctx, "GET", request_url)
j = r.json()
for app in j["value"]:
formatted = formatter(app)
app_list.append(formatted)

while j.get("nextLink") is not None:
request_url = j["nextLink"]
r = send_raw_request(cmd.cli_ctx, "GET", request_url)
j = r.json()
for app in j["value"]:
formatted = formatter(app)
app_list.append(formatted)

return app_list


class ContainerAppsResiliencyPreviewClient():
api_version = PREVIEW_API_VERSION
Expand Down
Loading
Loading