Skip to content

Commit 110dcea

Browse files
author
OGFTestPipeline
committed
add help docs
1 parent a0edbb5 commit 110dcea

File tree

4 files changed

+134
-7
lines changed

4 files changed

+134
-7
lines changed

src/azure-cli/azure/cli/command_modules/appservice/_help.py

Lines changed: 105 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,10 +2210,112 @@
22102210
helps['webapp sitecontainers create'] = """
22112211
type: command
22122212
short-summary: Create sitecontainers for a linux webapp
2213+
long-summary: |
2214+
Multiple sitecontainers can be added at once by passing arg --sitecontainer-spec-file, which is the path to a json file containing an array of sitecontainer specs.
2215+
Example json file:
2216+
[{
2217+
"name" : "firstcontainer",
2218+
"image": "myregistry.io/firstimage:latest",
2219+
"target_port": "80",
2220+
"is_main": true,
2221+
"environment_variables" : [
2222+
{
2223+
"name" : "hello",
2224+
"value": "world"
2225+
}
2226+
],
2227+
"volume_mounts": [
2228+
{
2229+
"container_mount_path" : "mountPath",
2230+
"data": "configData",
2231+
"read_only": true,
2232+
"volume_sub_path": "subPath"
2233+
}
2234+
]
2235+
},
2236+
{
2237+
"name" : "secondcontainer",
2238+
"image": "myregistry.io/secondimage:latest",
2239+
"target_port": "3000",
2240+
"is_main": false,
2241+
"auth_type": "SystemIdentity",
2242+
"start_up_command": "MyStartupCmd"
2243+
},
2244+
{
2245+
"name" : "thirdcontainer",
2246+
"image": "myregistry.io/thirdimage:latest",
2247+
"target_port": "3001",
2248+
"is_main": false,
2249+
"auth_type": "UserAssigned",
2250+
"user_managed_identity_client_id": "ClientID"
2251+
},
2252+
{
2253+
"name" : "thirdcontainer",
2254+
"image": "myregistry.io/thirdimage:latest",
2255+
"target_port": "3002",
2256+
"is_main": false,
2257+
"auth_type": "UserCredentials",
2258+
"user_name": "Username",
2259+
"password_secret": "Password"
2260+
}]
22132261
examples:
2214-
- name: Create sitecontainers for a linux webapp (autogenerated)
2215-
text: az webapp sitecontaienrs create --name MyWebApp --resource-group MyResourceGroup
2216-
crafted: true
2262+
- name: Create a sitecontainer for a linux webapp
2263+
text: az webapp sitecontainers create --name MyWebApp --resource-group MyResourceGroup --container-name MyContainer --image MyImageRegistry.io/MyImage:latest --target-port 80 --is-main
2264+
- name : Create multiple sitecontainers for a linux webapp using a json sitecontainer-spec file
2265+
text: az webapp sitecontainers create --name MyWebApp --resource-group MyResourceGroup --sitecontainer-spec-file ./sitecontainersspec.json
2266+
"""
2267+
2268+
2269+
helps['webapp sitecontainers update'] = """
2270+
type: command
2271+
short-summary: Update a sitecontainer for a linux webapp
2272+
examples:
2273+
- name: Update a sitecontainer for a linux webapp
2274+
text: az webapp sitecontainers update --name MyWebApp --resource-group MyResourceGroup --container-name MyContainer --image MyImageRegistry.io/MyImage:latest --target-port 3000 --is-main false
2275+
"""
2276+
2277+
2278+
helps['webapp sitecontainers delete'] = """
2279+
type: command
2280+
short-summary: Delete a sitecontainer for a linux webapp
2281+
examples:
2282+
- name: Delete a sitecontainer for a linux webapp
2283+
text: az webapp sitecontainers delete --name MyWebApp --resource-group MyResourceGroup --container-name MyContainer
2284+
"""
2285+
2286+
2287+
helps['webapp sitecontainers show'] = """
2288+
type: command
2289+
short-summary: List the details of a sitecontainer for a linux webapp
2290+
examples:
2291+
- name: List the details of a sitecontainer for a linux webapp
2292+
text: az webapp sitecontainers show --name MyWebApp --resource-group MyResourceGroup --container-name MyContainer
2293+
"""
2294+
2295+
2296+
helps['webapp sitecontainers list'] = """
2297+
type: command
2298+
short-summary: List all the sitecontainers for a linux webapp
2299+
examples:
2300+
- name: List all the sitecontainers for a linux webapp
2301+
text: az webapp sitecontainers list --name MyWebApp --resource-group MyResourceGroup --container-name MyContainer
2302+
"""
2303+
2304+
2305+
helps['webapp sitecontainers status'] = """
2306+
type: command
2307+
short-summary: Get the status of a sitecontainer for a linux webapp
2308+
examples:
2309+
- name: Get the status of a sitecontainer for a linux webapp
2310+
text: az webapp sitecontainers status --name MyWebApp --resource-group MyResourceGroup --container-name MyContainer
2311+
"""
2312+
2313+
helps['webapp sitecontainers log'] = """
2314+
type: command
2315+
short-summary: Get the logs of a sitecontainer for a linux webapp
2316+
examples:
2317+
- name: Get the logs of a sitecontainer for a linux webapp
2318+
text: az webapp sitecontainers log --name MyWebApp --resource-group MyResourceGroup --container-name MyContainer
22172319
"""
22182320

22192321

src/azure-cli/azure/cli/command_modules/appservice/_params.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,34 @@ def load_arguments(self, _):
173173
c.ignore('using_webapp_up')
174174

175175
with self.argument_context("webapp sitecontainers") as c:
176-
c.argument("create", help='Create sitecontainers for a linux webapp')
177-
c.argument("is_main", help="If true, this sitecontainer becomes the primary sitecontainer receiving frontend traffic.",
176+
c.argument('name', arg_type=webapp_name_arg_type, help='Name of the linux webapp')
177+
c.argument("container_name", help='Name of the SiteContainer')
178+
c.argument('slot', options_list=['--slot', '-s'], help='Name of the web app slot. Default to the productions slot if not specified.')
179+
180+
with self.argument_context("webapp sitecontainers create") as c:
181+
c.argument("image", help='Image Name')
182+
c.argument("target_port", help='Target port for SiteContainer')
183+
c.argument("startup_cmd", help='Startup Command for the SiteContainer')
184+
c.argument("is_main", help="true if the container is the main site container; false otherwise",
185+
arg_type=get_three_state_flag())
186+
c.argument("system_assigned_identity", help="If true, the system-assigned identity will be used for auth while pulling image",
187+
arg_type=get_three_state_flag())
188+
c.argument("user_assigned_identity", help='ClientID for the user-maganed identity which will be used for auth while pulling image')
189+
c.argument("registry_username", help='username used for image registry auth')
190+
c.argument("registry_password", help='password used for image registry auth')
191+
c.argument("sitecontainers_spec_file", help="path to a json sitecontainer spec file containing a list of sitecontainers, other sitecontainer input args will be ignored if this arg is provided")
192+
193+
with self.argument_context("webapp sitecontainers update") as c:
194+
c.argument("image", help='Image Name')
195+
c.argument("target_port", help='Target port for SiteContainer')
196+
c.argument("startup_cmd", help='Startup Command for the SiteContainer')
197+
c.argument("is_main", help="true if the container is the main site container; false otherwise",
198+
arg_type=get_three_state_flag())
199+
c.argument("system_assigned_identity", help="If true, the system-assigned identity will be used for auth while pulling image",
178200
arg_type=get_three_state_flag())
201+
c.argument("user_assigned_identity", help='ClientID for the user-maganed identity which will be used for auth while pulling image')
202+
c.argument("registry_username", help='username used for image registry auth')
203+
c.argument("registry_password", help='password used for image registry auth')
179204

180205
with self.argument_context('webapp show') as c:
181206
c.argument('name', arg_type=webapp_name_arg_type)

src/azure-cli/azure/cli/command_modules/appservice/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def load_command_table(self, _):
149149
g.custom_command('show', 'get_webapp_sitecontainer')
150150
g.custom_command('list', 'list_webapp_sitecontainers')
151151
g.custom_command('status', 'get_webapp_sitecontainers_status')
152-
g.custom_command('logs', 'get_webapp_sitecontainer_logs')
152+
g.custom_command('log', 'get_webapp_sitecontainer_log')
153153

154154
with self.command_group('webapp traffic-routing') as g:
155155
g.custom_command('set', 'set_traffic_routing')

src/azure-cli/azure/cli/command_modules/appservice/custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ def get_webapp_sitecontainers_status(cmd, name, resource_group, container_name=N
11851185
raise AzureInternalError("Failed to fetch sitecontainer status. Error: {}".format(str(ex)))
11861186

11871187

1188-
def get_webapp_sitecontainer_logs(cmd, name, resource_group, container_name, slot=None):
1188+
def get_webapp_sitecontainer_log(cmd, name, resource_group, container_name, slot=None):
11891189
scm_url = _get_scm_url(cmd, resource_group, name, slot)
11901190
site_container_logs_url = scm_url + '/api/sitecontainers/' + container_name + '/logs'
11911191
headers = get_scm_site_headers(cmd.cli_ctx, name, resource_group, slot)

0 commit comments

Comments
 (0)