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

web: type error in Status in ServerFarmWithRichSku class #137

Closed
lmazuel opened this issue Feb 12, 2016 · 2 comments
Closed

web: type error in Status in ServerFarmWithRichSku class #137

lmazuel opened this issue Feb 12, 2016 · 2 comments

Comments

@lmazuel
Copy link
Member

lmazuel commented Feb 12, 2016

Hello,

I work in the MS Azure Python SDK team and I'm currently trying the Autorest generated version for Python,
I created a App Service Plan using this Python SDK generated from the Web Swagger file (rev. c81ae63) with the ServerFarms_CreateOrUpdateServerFarm method.
I got in result:

{
    "id": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX/resourceGroups/test_mgmt_logic_test_logic90d30a9d/providers/Microsoft.Web/serverfarms/pyarmappserviceplan90d30a9d",
    "name": "pyarmappserviceplan90d30a9d",
    "type": "Microsoft.Web/serverfarms",
    "location": "West US",
    "tags": null,
    "properties": {
        "serverFarmId": 0,
        "name": "pyarmappserviceplan90d30a9d",
        "workerSize": 0,
        "workerSizeId": 0,
        "workerTierName": null,
        "numberOfWorkers": 0,
        "currentWorkerSize": 0,
        "currentWorkerSizeId": 0,
        "currentNumberOfWorkers": 0,
        "status": 0,
        "webSpace": "test_mgmt_logic_test_logic90d30a9d-WestUSwebspace",
        "subscription": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX",
        "adminSiteName": null,
        "hostingEnvironment": null,
        "hostingEnvironmentProfile": null,
        "maximumNumberOfWorkers": 1,
        "planName": "VirtualDedicatedPlan",
        "adminRuntimeSiteName": null,
        "computeMode": 0,
        "siteMode": null,
        "geoRegion": "West US",
        "perSiteScaling": false,
        "numberOfSites": 0,
        "hostingEnvironmentId": null,
        "tags": null,
        "kind": null,
        "resourceGroup": "test_mgmt_logic_test_logic90d30a9d"
    },
    "sku": {
        "name": "F1",
        "tier": "Free",
        "size": "F1",
        "family": "F",
        "capacity": 0
    }
}

Regarding the Swagger spec, "status" is an enum:

"status": {
              "description": "App Service Plan Status",
              "enum": [
                "Ready",
                "Pending"
              ],
              "type": "string",
              "readOnly": true,
              "x-ms-enum": {
                "name": "StatusOptions",
                "modelAsString": false
              }
            }

However, as you can see the status I got is 0, not a string in Ready or Pending.

Then the Python generated code is broken (I guess the C#, Java, etc. will be broken) too. Can you look at this?

At the same time, could someone from the team who own this file give me a status for it? Is it ready for a preview version in a generated client?

Thank you,

@amarzavery
Copy link
Contributor

@naveedaz - Can you please take a look into this issue?

@naveedaz
Copy link
Contributor

FYI. This issue is now fixed. Please use api-version >= 2016-09-01 for serverfarms for this change in behavior.

{ "id": "/subscriptions/1402be24-4f35-4ab7-a212-2cd496ebdf14/resourceGroups/naveeda-rg/providers/Microsoft.Web/serverfarms/Default1", "name": "Default1", "type": "Microsoft.Web/serverfarms", "location": "East US", "tags": null, "properties": { "serverFarmId": 0, "name": "Default1", "workerSize": "Small", "workerSizeId": 0, "workerTierName": null, "numberOfWorkers": 1, "currentWorkerSize": "Small", "currentWorkerSizeId": 0, "currentNumberOfWorkers": 1, "status": "Ready", "webSpace": "naveeda-rg-EastUSwebspace", "subscription": "1402be24-4f35-4ab7-a212-2cd496ebdf14", "adminSiteName": null, "hostingEnvironment": null, "hostingEnvironmentProfile": null, "maximumNumberOfWorkers": 20, "planName": "VirtualDedicatedPlan", "adminRuntimeSiteName": null, "computeMode": "Shared", "siteMode": null, "geoRegion": "East US", "perSiteScaling": false, "numberOfSites": 4, "hostingEnvironmentId": null, "tags": null, "kind": null, "resourceGroup": "naveeda-rg", "reserved": false, "mdmId": "waws-prod-blu-033_4740", "targetWorkerCount": 0, "targetWorkerSizeId": 0, "provisioningState": "Succeeded" }, "sku": { "name": "P1", "tier": "Premium", "size": "P1", "family": "P", "capacity": 1 }

hyonholee pushed a commit to hyonholee/azure-rest-api-specs that referenced this issue Sep 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants