From 1395211fe11fe6ccd300b24ce50731ad59568929 Mon Sep 17 00:00:00 2001 From: Olga Mirensky Date: Wed, 15 Jan 2020 14:25:51 +1100 Subject: [PATCH 1/6] Add openshift monitor subgroup --- src/azure-cli/HISTORY.rst | 4 +++ .../azure/cli/command_modules/acs/_help.py | 27 +++++++++++++++++ .../azure/cli/command_modules/acs/_params.py | 3 ++ .../azure/cli/command_modules/acs/commands.py | 6 ++++ .../azure/cli/command_modules/acs/custom.py | 30 +++++++++++++++---- 5 files changed, 65 insertions(+), 5 deletions(-) diff --git a/src/azure-cli/HISTORY.rst b/src/azure-cli/HISTORY.rst index 367061713f6..6012ba28239 100644 --- a/src/azure-cli/HISTORY.rst +++ b/src/azure-cli/HISTORY.rst @@ -26,6 +26,10 @@ Release History * Fix issue #11658: `az group export` command does not support `--query` and `--output` parameters * Fix issue #10279: The exit code of `az group deployment validate` is 0 when the verification fails +**Azure Red Hat OpenShift** + +* Add `monitor` subgroup to manage Log Analytics monitoring in Azure Red Hat OpensShift cluster + **IoT** * Deprecated 'IoT hub Job' commands. diff --git a/src/azure-cli/azure/cli/command_modules/acs/_help.py b/src/azure-cli/azure/cli/command_modules/acs/_help.py index db8a24447d1..bc44d777c74 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -959,3 +959,30 @@ text: |- az openshift wait -g MyResourceGroup -n MyManagedCluster --updated --interval 60 --timeout 1800 """ + +helps['openshift monitor'] = """ +type: group +short-summary: Commands to manage Log Analytics monitoring. Requires "--workspace-id". +""" + +helps['openshift monitor enable'] = """ +type: command +short-summary: Enable Log Analytics monitoring. Requires "--workspace-id". +parameters: + - name: --workspace-id + type: string + short-summary: The resource ID of an existing Log Analytics Workspace to use for storing monitoring data. +examples: + - name: Enable Log Analytics in a managed OpenShift cluster. + text: |- + az openshift monitor enable -g MyResourceGroup -n MyManagedCluster --workspace-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/workspaces/{workspace-id}" +""" + +helps['openshift monitor disable'] = """ +type: command +short-summary: Disable Log Analytics monitoring. +examples: + - name: Disable Log Analytics monitoring. + text: |- + az openshift monitor disable -g MyResourceGroup -n MyManagedCluster +""" diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index 2938d184ce0..faa74bb0b93 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -323,6 +323,9 @@ def load_arguments(self, _): c.argument('customer_admin_group_id', options_list=['--customer-admin-group-id']) c.argument('workspace_id') + with self.argument_context('openshift monitor enable') as c: + c.argument('workspace-id') + def _get_default_install_location(exe_name): system = platform.system() diff --git a/src/azure-cli/azure/cli/command_modules/acs/commands.py b/src/azure-cli/azure/cli/command_modules/acs/commands.py index 1436b0055cc..69f4af7a78d 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/commands.py @@ -124,3 +124,9 @@ def load_command_table(self, _): g.custom_show_command('show', 'openshift_show') g.custom_command('list', 'osa_list', table_transformer=osa_list_table_format) g.wait_command('wait') + + # OSA monitor subgroup + with self.command_group('openshift monitor', openshift_managed_clusters_sdk, + client_factory=cf_openshift_managed_clusters) as g: + g.custom_command('enable', 'openshift_monitor_enable', supports_no_wait=True) + g.custom_command('disable', 'openshift_monitor_disable', supports_no_wait=True) diff --git a/src/azure-cli/azure/cli/command_modules/acs/custom.py b/src/azure-cli/azure/cli/command_modules/acs/custom.py index 9436decc5eb..34468d1b493 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/custom.py +++ b/src/azure-cli/azure/cli/command_modules/acs/custom.py @@ -3113,6 +3113,15 @@ def osa_list(cmd, client, resource_group_name=None): return _remove_osa_nulls(list(managed_clusters)) +def _format_workspace_id(workspace_id): + workspace_id = workspace_id.strip() + if not workspace_id.startswith('/'): + workspace_id = '/' + workspace_id + if workspace_id.endswith('/'): + workspace_id = workspace_id.rstrip('/') + return workspace_id + + def openshift_create(cmd, client, resource_group_name, name, # pylint: disable=too-many-locals location=None, compute_vm_size="Standard_D4s_v3", @@ -3197,11 +3206,7 @@ def openshift_create(cmd, client, resource_group_name, name, # pylint: disable= name=vnet_peer ) if workspace_id is not None: - workspace_id = workspace_id.strip() - if not workspace_id.startswith('/'): - workspace_id = '/' + workspace_id - if workspace_id.endswith('/'): - workspace_id = workspace_id.rstrip('/') + workspace_id = _format_workspace_id(workspace_id) monitor_profile = OpenShiftManagedClusterMonitorProfile(enabled=True, workspace_resource_id=workspace_id) # pylint: disable=line-too-long else: monitor_profile = None @@ -3259,6 +3264,21 @@ def openshift_scale(cmd, client, resource_group_name, name, compute_count, no_wa return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, name, instance) +def openshift_monitor_enable(cmd, client, resource_group_name, name, workspace_id, no_wait=False): + instance = client.get(resource_group_name, name) + workspace_id = _format_workspace_id(workspace_id) + monitor_profile = OpenShiftManagedClusterMonitorProfile(enabled=True, workspace_resource_id=workspace_id) # pylint: disable=line-too-long + instance.monitor_profile = monitor_profile + + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, name, instance) + + +def openshift_monitor_disable(cmd, client, resource_group_name, name, no_wait=False): + instance = client.get(resource_group_name, name) + instance.monitor_profile = None + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, name, instance) + + def _get_load_balancer_outbound_ips(load_balancer_outbound_ips): """parse load balancer profile outbound IP ids and return an array of references to the outbound IP resources""" load_balancer_outbound_ip_resources = None From ea0d86de7df4179a3bfeba155a008e52c80ccdce Mon Sep 17 00:00:00 2001 From: Olga Mirensky Date: Wed, 15 Jan 2020 17:15:41 +1100 Subject: [PATCH 2/6] Add test for enabling monitor on existing ARO --- .../test_openshift_monitoring_enable.yaml | 877 ++++++++++++++++++ .../acs/tests/latest/test_osa_commands.py | 50 + 2 files changed, 927 insertions(+) create mode 100644 src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_openshift_monitoring_enable.yaml diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_openshift_monitoring_enable.yaml b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_openshift_monitoring_enable.yaml new file mode 100644 index 00000000000..6f940cee384 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_openshift_monitoring_enable.yaml @@ -0,0 +1,877 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + ParameterSetName: + - --display-name --key-type --password --identifier-uris + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-graphrbac/0.60.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + accept-language: + - en-US + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=startswith%28displayName%2C%27clitest000002%27%29&api-version=1.6 + response: + body: + string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[]}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json; odata=minimalmetadata; streaming=true; charset=utf-8 + dataserviceversion: + - 3.0; + date: + - Wed, 15 Jan 2020 06:04:06 GMT + duration: + - '2010076' + expires: + - '-1' + ocp-aad-diagnostics-server-name: + - 368Ee4wMDA+pKLHJOto3imsvSCQfolrdyq4lpctl9qk= + ocp-aad-session-key: + - P4FyCl_c8rXpVzmVutE5sJ5ktQ_GUw4Oq1s_a7TREenkC0PUnZMCu-hJMDZGV5vDtQUNvHkOi31fXN25yvIp0-gGU44ihTa5fVauOx_zMjVnyKNyim3pcytbVbkWSHKwqsladO9g3OUe84Zb7sWa5971ie63yChLrSUi4lfqch8.VeRV5H6FjjDmBvDRcdwxRtA7b_TSXEtR2ToRnfOwDtg + pragma: + - no-cache + request-id: + - 5e27258b-55a0-40b7-9fb8-48153b3c3cdd + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-ms-dirapi-data-contract-version: + - '1.6' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"availableToOtherTenants": false, "passwordCredentials": [{"startDate": + "2020-01-15T06:04:06.981324Z", "endDate": "2021-01-15T06:04:06.981324Z", "keyId": + "1fbca8a7-eb41-4455-9852-f4709988bf0b", "value": "ReplacedSPPassword123*"}], + "displayName": "ReplacedSPPassword123*", "identifierUris": ["http://ReplacedSPPassword123*"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app create + Connection: + - keep-alive + Content-Length: + - '331' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --display-name --key-type --password --identifier-uris + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-graphrbac/0.60.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + accept-language: + - en-US + method: POST + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?api-version=1.6 + response: + body: + string: '{"odata.metadata": "https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/@Element", + "odata.type": "Microsoft.DirectoryServices.Application", "objectType": "Application", + "objectId": "ed73cfce-9971-4879-ba1f-9468f5e5b097", "deletionTimestamp": null, + "acceptMappedClaims": null, "addIns": [], "appId": "06e2aec6-fc02-4018-b803-7f9d02821f5b", + "applicationTemplateId": null, "appRoles": [], "availableToOtherTenants": + false, "displayName": "clitest000002", "errorUrl": null, "groupMembershipClaims": + null, "homepage": null, "identifierUris": ["http://clitest000002"], "informationalUrls": + {"termsOfService": null, "support": null, "privacy": null, "marketing": null}, + "isDeviceOnlyAuthSupported": null, "keyCredentials": [], "knownClientApplications": + [], "logoutUrl": null, "logo@odata.mediaEditLink": "directoryObjects/ed73cfce-9971-4879-ba1f-9468f5e5b097/Microsoft.DirectoryServices.Application/logo", + "logo@odata.mediaContentType": "application/json;odata=minimalmetadata; charset=utf-8", + "logoUrl": null, "mainLogo@odata.mediaEditLink": "directoryObjects/ed73cfce-9971-4879-ba1f-9468f5e5b097/Microsoft.DirectoryServices.Application/mainLogo", + "oauth2AllowIdTokenImplicitFlow": true, "oauth2AllowImplicitFlow": false, + "oauth2AllowUrlPathMatching": false, "oauth2Permissions": [{"adminConsentDescription": + "Allow the application to access clitest000002 on behalf of the signed-in + user.", "adminConsentDisplayName": "Access clitest000002", "id": "2de2a0cb-1416-4bf7-b4ab-c36248662453", + "isEnabled": true, "type": "User", "userConsentDescription": "Allow the application + to access clitest000002 on your behalf.", "userConsentDisplayName": "Access + clitest000002", "value": "user_impersonation"}], "oauth2RequirePostResponse": + false, "optionalClaims": null, "orgRestrictions": [], "parentalControlSettings": + {"countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow"}, "passwordCredentials": + [{"customKeyIdentifier": null, "endDate": "2021-01-15T06:04:06.981324Z", "keyId": + "1fbca8a7-eb41-4455-9852-f4709988bf0b", "startDate": "2020-01-15T06:04:06.981324Z", + "value": "ReplacedSPPassword123*"}], "publicClient": null, "publisherDomain": + "rhcuppettgmail.onmicrosoft.com", "recordConsentConditions": null, "replyUrls": + [], "requiredResourceAccess": [], "samlMetadataUrl": null, "signInAudience": + "AzureADMyOrg", "tokenEncryptionKeyId": null}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '2303' + content-type: + - application/json; odata=minimalmetadata; streaming=true; charset=utf-8 + dataserviceversion: + - 3.0; + date: + - Wed, 15 Jan 2020 06:04:06 GMT + duration: + - '5770754' + expires: + - '-1' + location: + - https://graph.windows.net/00000000-0000-0000-0000-000000000000/directoryObjects/ed73cfce-9971-4879-ba1f-9468f5e5b097/Microsoft.DirectoryServices.Application + ocp-aad-diagnostics-server-name: + - Gb2x7qjWXmcL1WXWw2JJMQYvUggHuquZ6MYO+AXjTx8= + ocp-aad-session-key: + - ePHlhlk9FoeZomlEIpzFr98Rwwn0tzK_R_L0fPZvQehqP0UNPKe09MVeS97qfztkzwqcMe9zwSGBFDMc7PwnfQdnMW8hGA2eCy52Fwb-zh9ydXJQWIA0F4nyFn1aVzLCaKrFuH6pWi1okdsUk9XUZxoUU58f9s3HPEbtjIWoaD8.oL6QWlXGRG8janM2dg_LMokBaZrxpp3Rc__2ZHz50jg + pragma: + - no-cache + request-id: + - c4e26c5f-7a98-4357-9203-e149c07aa5ec + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-ms-dirapi-data-contract-version: + - '1.6' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitestosa000001/providers/Microsoft.ContainerService/openShiftManagedClusters/clitestosa000003?api-version=2019-09-30-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.ContainerService/openShiftManagedClusters/clitestosa000003'' + under resource group ''clitestosa000001'' was not found."}}' + headers: + cache-control: + - no-cache + content-length: + - '188' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 15 Jan 2020 06:04:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: 'b''{"location": "eastus", "properties": {"openShiftVersion": "v3.11", "networkProfile": + {"vnetCidr": "10.0.0.0/8"}, "routerProfiles": [{"name": "default"}], "masterPoolProfile": + {"name": "master", "count": 3, "vmSize": "Standard_D4s_v3", "subnetCidr": "10.0.0.0/24", + "osType": "Linux"}, "agentPoolProfiles": [{"name": "compute", "count": 1, "vmSize": + "Standard_D4s_v3", "subnetCidr": "10.0.0.0/24", "osType": "Linux", "role": "compute"}, + {"name": "infra", "count": 3, "vmSize": "Standard_D4s_v3", "subnetCidr": "10.0.0.0/24", + "osType": "Linux", "role": "infra"}], "authProfile": {"identityProviders": [{"name": + "Azure AD", "provider": {"kind": "AADIdentityProvider", "clientId": "06e2aec6-fc02-4018-b803-7f9d02821f5b", + "secret": "clitest000002", "tenantId": "7a1815fb-63ba-4af7-8f33-e7333e421980"}}]}}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + Content-Length: + - '810' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitestosa000001/providers/Microsoft.ContainerService/openShiftManagedClusters/clitestosa000003?api-version=2019-09-30-preview + response: + body: + string: "{\n \"properties\": {\n \"provisioningState\": \"Creating\",\n \ + \ \"openShiftVersion\": \"v3.11\",\n \"clusterVersion\": \"aro.15\",\n\ + \ \"publicHostname\": \"openshift.1797c73ba73149ea9a5d.eastus.azmosa.io\"\ + ,\n \"fqdn\": \"osa0b82925bd9d8462fad09.eastus.cloudapp.azure.com\",\n \ + \ \"networkProfile\": {\n \"vnetCidr\": \"10.0.0.0/8\",\n \"vnetId\"\ + : \"\"\n },\n \"routerProfiles\": [\n {\n \"name\": \"default\"\ + ,\n \"publicSubdomain\": \"apps.1797c73ba73149ea9a5d.eastus.azmosa.io\"\ + ,\n \"fqdn\": \"osa052567ab6250465cbecf.eastus.cloudapp.azure.com\"\n\ + \ }\n ],\n \"masterPoolProfile\": {\n \"count\": 3,\n \"vmSize\"\ + : \"Standard_D4s_v3\",\n \"subnetCidr\": \"10.0.0.0/24\"\n },\n \"\ + agentPoolProfiles\": [\n {\n \"name\": \"compute\",\n \"count\"\ + : 1,\n \"vmSize\": \"Standard_D4s_v3\",\n \"subnetCidr\": \"10.0.0.0/24\"\ + ,\n \"osType\": \"Linux\",\n \"role\": \"compute\"\n },\n {\n\ + \ \"name\": \"infra\",\n \"count\": 3,\n \"vmSize\": \"Standard_D4s_v3\"\ + ,\n \"subnetCidr\": \"10.0.0.0/24\",\n \"osType\": \"Linux\",\n \ + \ \"role\": \"infra\"\n }\n ],\n \"authProfile\": {\n \"identityProviders\"\ + : [\n {\n \"name\": \"Azure AD\",\n \"provider\": {\n \ + \ \"kind\": \"AADIdentityProvider\",\n \"clientId\": \"06e2aec6-fc02-4018-b803-7f9d02821f5b\"\ + ,\n \"tenantId\": \"7a1815fb-63ba-4af7-8f33-e7333e421980\"\n }\n\ + \ }\n ]\n },\n \"monitorProfile\": {\n \"enabled\": false,\n\ + \ \"workspaceResourceId\": \"\"\n }\n },\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitestosa000001/providers/Microsoft.ContainerService/openshiftmanagedClusters/clitestosa000003\"\ + ,\n \"name\": \"clitestosa000003\",\n \"type\": \"Microsoft.ContainerService/OpenShiftManagedClusters\"\ + ,\n \"location\": \"eastus\",\n \"tags\": {}\n }" + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/ec0fe00b-3c13-4ed8-9cf5-408c1cf9086e?api-version=2018-10-31 + cache-control: + - no-cache + content-length: + - '1683' + content-type: + - application/json + date: + - Wed, 15 Jan 2020 06:04:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/ec0fe00b-3c13-4ed8-9cf5-408c1cf9086e?api-version=2018-10-31 + response: + body: + string: "{\n \"name\": \"0be00fec-133c-d84e-9cf5-408c1cf9086e\",\n \"status\"\ + : \"InProgress\",\n \"startTime\": \"2020-01-15T06:04:18.3933659Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Wed, 15 Jan 2020 06:04:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/ec0fe00b-3c13-4ed8-9cf5-408c1cf9086e?api-version=2018-10-31 + response: + body: + string: "{\n \"name\": \"0be00fec-133c-d84e-9cf5-408c1cf9086e\",\n \"status\"\ + : \"InProgress\",\n \"startTime\": \"2020-01-15T06:04:18.3933659Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Wed, 15 Jan 2020 06:05:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/ec0fe00b-3c13-4ed8-9cf5-408c1cf9086e?api-version=2018-10-31 + response: + body: + string: "{\n \"name\": \"0be00fec-133c-d84e-9cf5-408c1cf9086e\",\n \"status\"\ + : \"InProgress\",\n \"startTime\": \"2020-01-15T06:04:18.3933659Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Wed, 15 Jan 2020 06:05:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/ec0fe00b-3c13-4ed8-9cf5-408c1cf9086e?api-version=2018-10-31 + response: + body: + string: "{\n \"name\": \"0be00fec-133c-d84e-9cf5-408c1cf9086e\",\n \"status\"\ + : \"InProgress\",\n \"startTime\": \"2020-01-15T06:04:18.3933659Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Wed, 15 Jan 2020 06:06:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/ec0fe00b-3c13-4ed8-9cf5-408c1cf9086e?api-version=2018-10-31 + response: + body: + string: "{\n \"name\": \"0be00fec-133c-d84e-9cf5-408c1cf9086e\",\n \"status\"\ + : \"InProgress\",\n \"startTime\": \"2020-01-15T06:04:18.3933659Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Wed, 15 Jan 2020 06:06:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/ec0fe00b-3c13-4ed8-9cf5-408c1cf9086e?api-version=2018-10-31 + response: + body: + string: "{\n \"name\": \"0be00fec-133c-d84e-9cf5-408c1cf9086e\",\n \"status\"\ + : \"InProgress\",\n \"startTime\": \"2020-01-15T06:04:18.3933659Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Wed, 15 Jan 2020 06:07:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/ec0fe00b-3c13-4ed8-9cf5-408c1cf9086e?api-version=2018-10-31 + response: + body: + string: "{\n \"name\": \"0be00fec-133c-d84e-9cf5-408c1cf9086e\",\n \"status\"\ + : \"InProgress\",\n \"startTime\": \"2020-01-15T06:04:18.3933659Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Wed, 15 Jan 2020 06:07:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - openshift create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --compute-count --aad-client-app-id --aad-client-app-secret + --aad-tenant-id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-containerservice/8.0.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/ec0fe00b-3c13-4ed8-9cf5-408c1cf9086e?api-version=2018-10-31 + response: + body: + string: "{\n \"name\": \"0be00fec-133c-d84e-9cf5-408c1cf9086e\",\n \"status\"\ + : \"Failed\",\n \"startTime\": \"2020-01-15T06:04:18.3933659Z\",\n \"endTime\"\ + : \"2020-01-15T06:08:04.4632491Z\",\n \"error\": {\n \"code\": \"CreateManagedAppError\"\ + ,\n \"message\": \"unable to create managed app. error: managedapplications.ApplicationsClient#CreateOrUpdate:\ + \ Failure sending request: StatusCode=0 -- Original Error: autorest/azure:\ + \ Service returned an error. Status=\\u003cnil\\u003e Code=\\\"ApplianceBeingDeleted\\\ + \" Message=\\\"The operation '\\u003cnull\\u003e' cannot be performed on the\ + \ appliance 'OS_clitestosa000001_clitestosa000003_eastus' because it is being\ + \ deleted.\\\"\"\n }\n }" + headers: + cache-control: + - no-cache + content-length: + - '640' + content-type: + - application/json + date: + - Wed, 15 Jan 2020 06:08:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app delete + Connection: + - keep-alive + ParameterSetName: + - --id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-graphrbac/0.60.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + accept-language: + - en-US + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=identifierUris%2Fany%28s%3As%20eq%20%2706e2aec6-fc02-4018-b803-7f9d02821f5b%27%29&api-version=1.6 + response: + body: + string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[]}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json; odata=minimalmetadata; streaming=true; charset=utf-8 + dataserviceversion: + - 3.0; + date: + - Wed, 15 Jan 2020 06:08:25 GMT + duration: + - '2018443' + expires: + - '-1' + ocp-aad-diagnostics-server-name: + - K3c4HDsd49YJALs5QZYFWCZXAibSIuNgH0HMT0cyA7s= + ocp-aad-session-key: + - xrAUBw8Lso95KmJSKmcUiHOWrNsUU-fJbWDmVOGmZS62RcfGBtCnR-z1FZjuNr1rNSjwtRHkk3fIGpJMQhP3YR5AWExgjnuTOSpRmhh8CkJybnvLVeFmSa-MOUYT8q9B1nX8oDPurbztwAUKVc8kcS6ODwzrGNPssrRC2MoPEAk.GvgYBBJypZanae1FaE8QfUzUuR55QqLiaGIxVh3gk4s + pragma: + - no-cache + request-id: + - eb77f759-1baa-42ca-8c46-0bba4e45e779 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-ms-dirapi-data-contract-version: + - '1.6' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app delete + Connection: + - keep-alive + ParameterSetName: + - --id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-graphrbac/0.60.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + accept-language: + - en-US + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=appId%20eq%20%2706e2aec6-fc02-4018-b803-7f9d02821f5b%27&api-version=1.6 + response: + body: + string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[{"odata.type":"Microsoft.DirectoryServices.Application","objectType":"Application","objectId":"ed73cfce-9971-4879-ba1f-9468f5e5b097","deletionTimestamp":null,"acceptMappedClaims":null,"addIns":[],"appId":"06e2aec6-fc02-4018-b803-7f9d02821f5b","applicationTemplateId":null,"appRoles":[],"availableToOtherTenants":false,"displayName":"clitest000002","errorUrl":null,"groupMembershipClaims":null,"homepage":null,"identifierUris":["http://clitest000002"],"informationalUrls":{"termsOfService":null,"support":null,"privacy":null,"marketing":null},"isDeviceOnlyAuthSupported":null,"keyCredentials":[],"knownClientApplications":[],"logoutUrl":null,"logo@odata.mediaEditLink":"directoryObjects/ed73cfce-9971-4879-ba1f-9468f5e5b097/Microsoft.DirectoryServices.Application/logo","logoUrl":null,"mainLogo@odata.mediaEditLink":"directoryObjects/ed73cfce-9971-4879-ba1f-9468f5e5b097/Microsoft.DirectoryServices.Application/mainLogo","oauth2AllowIdTokenImplicitFlow":true,"oauth2AllowImplicitFlow":false,"oauth2AllowUrlPathMatching":false,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access clitest000002 on behalf of the signed-in user.","adminConsentDisplayName":"Access + clitest000002","id":"2de2a0cb-1416-4bf7-b4ab-c36248662453","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access clitest000002 on your behalf.","userConsentDisplayName":"Access + clitest000002","value":"user_impersonation"}],"oauth2RequirePostResponse":false,"optionalClaims":null,"orgRestrictions":[],"parentalControlSettings":{"countriesBlockedForMinors":[],"legalAgeGroupRule":"Allow"},"passwordCredentials":[{"customKeyIdentifier":null,"endDate":"2021-01-15T06:04:06.981324Z","keyId":"1fbca8a7-eb41-4455-9852-f4709988bf0b","startDate":"2020-01-15T06:04:06.981324Z","value":null}],"publicClient":null,"publisherDomain":"rhcuppettgmail.onmicrosoft.com","recordConsentConditions":null,"replyUrls":[],"requiredResourceAccess":[],"samlMetadataUrl":null,"signInAudience":"AzureADMyOrg","tokenEncryptionKeyId":null}]}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '2220' + content-type: + - application/json; odata=minimalmetadata; streaming=true; charset=utf-8 + dataserviceversion: + - 3.0; + date: + - Wed, 15 Jan 2020 06:08:26 GMT + duration: + - '1693498' + expires: + - '-1' + ocp-aad-diagnostics-server-name: + - ArAfqA2TmoZJ2pSA7j0uVeVsVp05coAuH4D8kXlaLi4= + ocp-aad-session-key: + - 9uQ1hQSlAFZO8vNbhcZofg6kDAAa-On9CuyFxsjGnIilUs9_SBqLuYEdL6fGGGKhnM3DAZwOKvyfXmjh2zLtZtpfvx3D_9CflHMUkp-To5k7IuUgpV2lTYmci0Wek562IPbZNkFwE6PST4AdqCDA21pO9R9dT7t4Bwci-6gSREY.krHTr4x7l0AsZtVFNXq9ZprsjYDDI-_sencCyl44_xo + pragma: + - no-cache + request-id: + - 65192e14-c94c-4259-9ec3-e6ac1171fc0d + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-ms-dirapi-data-contract-version: + - '1.6' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ad app delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --id + User-Agent: + - python/3.7.4 (Linux-4.18.0-80.11.2.el8_0.x86_64-x86_64-with-redhat-8.0-Ootpa) + msrest/0.6.10 msrest_azure/0.6.2 azure-graphrbac/0.60.0 Azure-SDK-For-Python + AZURECLI/2.0.80 + accept-language: + - en-US + method: DELETE + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications/ed73cfce-9971-4879-ba1f-9468f5e5b097?api-version=1.6 + response: + body: + string: '' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + date: + - Wed, 15 Jan 2020 06:08:32 GMT + duration: + - '60053142' + expires: + - '-1' + ocp-aad-diagnostics-server-name: + - mjwEHTrjurgt/7wAWFnUSc/pRK8OrX+nRj8mvQINZj0= + ocp-aad-session-key: + - UKF7P61QE-a1SxCvsvli8mIHf9cxiF80GVuaym6bYi0EyFBWOVQYrMUPBGCbHjGLpS81AMwJzLR0hr17tqAw7kNJ8iL9Ecc8HObIX6SRTMU9FX_48dAWTS1XjbWmjEiRJjrRALlEGz3madhkyAxYVsCuortnwRIm2fByCCUxbxc.xEeUO8YpNatV4kMaFplehCYXic3fKmJnswX67EX5dtI + pragma: + - no-cache + request-id: + - 00e3079c-e01b-4627-87e5-90cfdef4b583 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-ms-dirapi-data-contract-version: + - '1.6' + x-powered-by: + - ASP.NET + status: + code: 204 + message: No Content +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_osa_commands.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_osa_commands.py index a2fbfaf3bce..dd988c64625 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_osa_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_osa_commands.py @@ -192,3 +192,53 @@ def test_openshift_create_with_monitoring(self, resource_group, resource_group_l # delete self.cmd('openshift delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()]) + @live_only() + @ResourceGroupPreparer(random_name_length=17, name_prefix='clitestosa', location='eastus') + @ManagedApplicationPreparer() + def test_openshift_monitoring_enable(self, resource_group, resource_group_location, aad_client_app_id, aad_client_app_secret): + # kwargs for string formatting + osa_name = self.create_random_name('clitestosa', 15) + self.kwargs.update({ + 'resource_group': resource_group, + 'name': osa_name, + 'location': resource_group_location, + 'aad_client_app_id': aad_client_app_id, + 'aad_client_app_secret': aad_client_app_secret + }) + account = self.cmd("account show").get_output_in_json() + tenant_id = account["tenantId"] + self.kwargs.update({ + 'tenant_id': tenant_id + }) + + # create without monitoring + create_cmd = 'openshift create --resource-group={resource_group} --name={name} --location={location} ' \ + '--compute-count=1 ' \ + '--aad-client-app-id {aad_client_app_id} --aad-client-app-secret {aad_client_app_secret} ' \ + '--aad-tenant-id {tenant_id}' + self.cmd(create_cmd, checks=[self.is_empty()]) + + # show + self.cmd('openshift show -g {resource_group} -n {name}', checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{resource_group}'), + self.exists('openShiftVersion'), + ]) + + workspace = self.cmd("monitor log-analytics workspace create -g {resource_group} -n {name}").get_output_in_json() + workspace_id = workspace["id"] + self.kwargs.update({ + 'workspace_id': workspace_id, + }) + monitor_enable_cmd = 'openshift monitor enable --resource-group={resource_group} --name={name} --location={location} ' \ + '--workspace-id {workspace_id}' + + self.cmd(monitor_enable_cmd, checks=[self.is_empty()]) + + self.cmd('openshift show -g {resource_group} -n {name}', checks=[ + self.exists('monitorProfile') + ]) + + # delete + self.cmd('openshift delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()]) + From 6c2f1401c712c6f0259e2c57c02d27945e12391b Mon Sep 17 00:00:00 2001 From: Olga Mirensky Date: Mon, 20 Jan 2020 14:35:13 +1100 Subject: [PATCH 3/6] Fix disable monitor --- src/azure-cli/azure/cli/command_modules/acs/custom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/custom.py b/src/azure-cli/azure/cli/command_modules/acs/custom.py index 34468d1b493..65b5f70bea3 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/custom.py +++ b/src/azure-cli/azure/cli/command_modules/acs/custom.py @@ -3275,7 +3275,8 @@ def openshift_monitor_enable(cmd, client, resource_group_name, name, workspace_i def openshift_monitor_disable(cmd, client, resource_group_name, name, no_wait=False): instance = client.get(resource_group_name, name) - instance.monitor_profile = None + monitor_profile = OpenShiftManagedClusterMonitorProfile(enabled=False, workspace_resource_id=None) # pylint: disable=line-too-long + instance.monitor_profile = monitor_profile return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, name, instance) From f0f9a88d64cc9ff86e0ec707540f1607c21137bd Mon Sep 17 00:00:00 2001 From: Olga Mirensky Date: Tue, 21 Jan 2020 14:37:17 +1100 Subject: [PATCH 4/6] Move parameter help text to params file --- src/azure-cli/azure/cli/command_modules/acs/_help.py | 4 ---- src/azure-cli/azure/cli/command_modules/acs/_params.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/_help.py b/src/azure-cli/azure/cli/command_modules/acs/_help.py index bc44d777c74..4ed0f063f72 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -968,10 +968,6 @@ helps['openshift monitor enable'] = """ type: command short-summary: Enable Log Analytics monitoring. Requires "--workspace-id". -parameters: - - name: --workspace-id - type: string - short-summary: The resource ID of an existing Log Analytics Workspace to use for storing monitoring data. examples: - name: Enable Log Analytics in a managed OpenShift cluster. text: |- diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index faa74bb0b93..fc729860069 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -324,7 +324,7 @@ def load_arguments(self, _): c.argument('workspace_id') with self.argument_context('openshift monitor enable') as c: - c.argument('workspace-id') + c.argument('workspace-id', help='The resource ID of an existing Log Analytics Workspace to use for storing monitoring data.') def _get_default_install_location(exe_name): From a56c19ca57dbe3f41b4e6c3000af27359ededcbe Mon Sep 17 00:00:00 2001 From: Olga Mirensky Date: Tue, 21 Jan 2020 14:45:56 +1100 Subject: [PATCH 5/6] Restore parameter help --- src/azure-cli/azure/cli/command_modules/acs/_help.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/azure-cli/azure/cli/command_modules/acs/_help.py b/src/azure-cli/azure/cli/command_modules/acs/_help.py index 4ed0f063f72..bc44d777c74 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -968,6 +968,10 @@ helps['openshift monitor enable'] = """ type: command short-summary: Enable Log Analytics monitoring. Requires "--workspace-id". +parameters: + - name: --workspace-id + type: string + short-summary: The resource ID of an existing Log Analytics Workspace to use for storing monitoring data. examples: - name: Enable Log Analytics in a managed OpenShift cluster. text: |- From d67827041b2f2c4c5eecfe305e9324478286d995 Mon Sep 17 00:00:00 2001 From: Olga Mirensky Date: Wed, 29 Jan 2020 15:11:32 +1100 Subject: [PATCH 6/6] Fix help --- src/azure-cli/azure/cli/command_modules/acs/_help.py | 4 ---- src/azure-cli/azure/cli/command_modules/acs/_params.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/_help.py b/src/azure-cli/azure/cli/command_modules/acs/_help.py index bc44d777c74..4ed0f063f72 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -968,10 +968,6 @@ helps['openshift monitor enable'] = """ type: command short-summary: Enable Log Analytics monitoring. Requires "--workspace-id". -parameters: - - name: --workspace-id - type: string - short-summary: The resource ID of an existing Log Analytics Workspace to use for storing monitoring data. examples: - name: Enable Log Analytics in a managed OpenShift cluster. text: |- diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index fc729860069..6bdce4ca095 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -324,7 +324,7 @@ def load_arguments(self, _): c.argument('workspace_id') with self.argument_context('openshift monitor enable') as c: - c.argument('workspace-id', help='The resource ID of an existing Log Analytics Workspace to use for storing monitoring data.') + c.argument('workspace_id', help='The resource ID of an existing Log Analytics Workspace to use for storing monitoring data.') def _get_default_install_location(exe_name):