Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operations Management client problems #1333

Closed
lawrencegripper opened this issue Mar 19, 2018 · 2 comments
Closed

Operations Management client problems #1333

lawrencegripper opened this issue Mar 19, 2018 · 2 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Operations Management

Comments

@lawrencegripper
Copy link
Contributor

lawrencegripper commented Mar 19, 2018

Hi,

Context

I recently worked with a team who are using Terraform to deploy AKS and wanted to enable Log Analytics Container Monitoring solution as well. As part of the work I created a Terraform resource for the RP but spotted a couple of odd things along that way which I had to work around.

Issues

  1. Create method parameters

The client seems to take in an odd set of input into it's "New Client" method which I wouldn't expect to see. I was able to work around this by passing in some values like this but I don't think this should be required. I wasn't able to tell from the swagger definition why this was happening so I assumed it was in the codegen but it's very likely I missed something.

  1. Successful creation returns an error

When calling the CreateOrUpdate the err returned is non-nil even if the create request succeeds.

This appears to be because the swagger doc it wrong. The service returns a "201 Created" and the docs suggest it returns a 200

Request Created

PUT /subscriptions/SUBHERE/resourcegroups/oms-acctestRG-101589505992913122/providers/Microsoft.OperationsManagement/solutions/Containers%28acctest-dep-101589505992913122%29?api-version=2015-11-01-preview HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.10 (amd64-darwin) go-autorest/8.0.0 Azure-SDK-For-Go/v12.5.0-beta services;HashiCorp-Terraform-v0.11.3
Content-Length: 436
Content-Type: application/json
Accept-Encoding: gzip

{"name":"Containers(acctest-dep-101589505992913122)","location":"westeurope","plan":{"name":"Containers(acctest-dep-101589505992913122)","publisher":"Microsoft","promotionCode":"","product":"OMSGallery/Containers"},"properties":{"workspaceResourceId":"/subscriptions/SUBHERE/resourcegroups/oms-acctestrg-101589505992913122/providers/microsoft.operationalinsights/workspaces/acctest-dep-101589505992913122"}}

Response Received

HTTP/1.1 201 Created
Content-Length: 1191
...
Content-Type: application/json; charset=utf-8
Date: Mon, 19 Mar 2018 17:35:48 GMT
Expires: -1
Pragma: no-cache
Server: Microsoft-IIS/8.5
Server: Microsoft-IIS/10.0
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Ams-Apiversion: WebAPI1.0
X-Aspnet-Version: 4.0.30319
X-Content-Type-Options: nosniff
....
X-Powered-By: ASP.NET

{
  "plan": {
    "name": "Containers(acctest-dep-101589505992913122)",
    "publisher": "Microsoft",
    "promotionCode": "",
    "product": "OMSGallery/Containers"
  },
  "properties": {
    "workspaceResourceId": "/subscriptions/SUBHERE/resourcegroups/oms-acctestrg-101589505992913122/providers/microsoft.operationalinsights/workspaces/acctest-dep-101589505992913122",
    "provisioningState": "Succeeded",
    "creationTime": "Mon, 01 Jan 0001 00:00:00 GMT",
"lastModifiedTime": "Mon, 01 Jan 0001 00:00:00 GMT",
    "containedResources": [
      "/subscriptions/SUBHERE/resourcegroups/oms-acctestrg-101589505992913122/providers/Microsoft.OperationalInsights/workspaces/acctest-dep-101589505992913122/views/Containers(acctest-dep-101589505992913122)"
    ]
  },
  "id": "/subscriptions/SUBHERE/resourcegroups/oms-acctestrg-101589505992913122/providers/Microsoft.OperationsManagement/solutions/Containers(acctest-dep-101589505992913122)",
  "name": "Containers(acctest-dep-101589505992913122)",
  "type": "Microsoft.OperationsManagement/solutions",
  "location": "West Europe"
}


@vladbarosan
Copy link

@lawrencegripper we reached out to the OperationsManagement team and indeed the spec is out of date. Adding @dashimi16 who added the initial spec to provide an ETA of when the spec is expected to be updated.

@vladbarosan
Copy link

@lawrencegripper this has been fixed in v18 https://github.com/Azure/azure-sdk-for-go/blob/master/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/solutions.go . Also please use the package listed ( under services/preview since the one under services/ is deprecated.

@ghost ghost removed the in progress label Jul 23, 2018
@RickWinter RickWinter added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jul 12, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Operations Management
Projects
None yet
Development

No branches or pull requests

5 participants