Skip to content

Commit

Permalink
Swagger validations for serverless parameters added in SQL API (#25852)
Browse files Browse the repository at this point in the history
* Swagger validations for serverless parameters added in SQL API

* Fixing spellcheck in example file

* Fix LintDiff error

---------

Co-authored-by: Yash Udasi <[email protected]>
  • Loading branch information
Yashu1818 and Yash Udasi authored Sep 26, 2023
1 parent 57d8513 commit 0db53b9
Show file tree
Hide file tree
Showing 5 changed files with 283 additions and 6 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,25 @@
},
"readOnly": true
},
"supportedMinCapacities": {
"description": "List of supported min capacities",
"type": "array",
"items": {
"$ref": "#/definitions/MinCapacityCapability"
},
"readOnly": true,
"x-ms-identifiers": []
},
"supportedAutoPauseDelay": {
"$ref": "#/definitions/AutoPauseDelayTimeRange",
"description": "Supported time range for auto pause delay",
"readOnly": true
},
"supportedPerDatabaseAutoPauseDelay": {
"$ref": "#/definitions/PerDatabaseAutoPauseDelayTimeRange",
"description": "Supported time range for per database auto pause delay",
"readOnly": true
},
"status": {
"description": "The status of the capability.",
"enum": [
Expand Down Expand Up @@ -1283,6 +1302,54 @@
}
}
},
"PerDatabaseAutoPauseDelayTimeRange": {
"description": "Supported auto pause delay time range",
"type": "object",
"properties": {
"minValue": {
"format": "int32",
"description": "Minimum value",
"type": "integer",
"readOnly": true
},
"maxValue": {
"format": "int32",
"description": "Maximum value",
"type": "integer",
"readOnly": true
},
"stepSize": {
"format": "int32",
"description": "Step value for discrete values between the minimum value and the maximum value.",
"type": "integer",
"readOnly": true
},
"default": {
"format": "int32",
"description": "Default value if no value is provided",
"type": "integer",
"readOnly": true
},
"unit": {
"description": "Unit of time that delay is expressed in",
"enum": [
"Minutes"
],
"type": "string",
"readOnly": true,
"x-ms-enum": {
"name": "PauseDelayTimeUnit",
"modelAsString": true
}
},
"doNotPauseValue": {
"format": "int32",
"description": "Value that is used to not pause (infinite delay before pause)",
"type": "integer",
"readOnly": true
}
}
},
"PerformanceLevelCapability": {
"description": "The performance level capability.",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "sqlcrudtest-2369",
"serverName": "sqlcrudtest-8069",
"elasticPoolName": "sqlcrudtest-8102",
"api-version": "2023-05-01-preview",
"parameters": {
"location": "Japan East",
"sku": {
"name": "GP_S_Gen5_2",
"tier": "GeneralPurpose",
"capacity": 2
},
"properties": {
"minCapacity": 0.5,
"autoPauseDelay": 60,
"perDatabaseSettings": {
"minCapacity": 0,
"maxCapacity": 2.0,
"autoPauseDelay": 80
}
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"location": "Japan East",
"kind": null,
"sku": {
"name": "GP_S_Gen5_2",
"tier": "GeneralPurpose",
"capacity": 2
},
"properties": {
"creationDate": "2017-02-10T01:25:25.033Z",
"state": "Ready",
"maxSizeBytes": 102400,
"minCapacity": 0.5,
"autoPauseDelay": 60,
"perDatabaseSettings": {
"minCapacity": 0,
"maxCapacity": 2.0,
"autoPauseDelay": 80
}
}
}
},
"201": {
"headers": {
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2023-05-01"
},
"body": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"location": "Japan East",
"kind": null,
"sku": {
"name": "GP_S_Gen5_2",
"tier": "GeneralPurpose",
"capacity": 2
},
"properties": {
"creationDate": "2017-02-10T01:25:25.033Z",
"state": "Ready",
"maxSizeBytes": 102400,
"minCapacity": 0.5,
"autoPauseDelay": 60,
"perDatabaseSettings": {
"minCapacity": 0,
"maxCapacity": 2.0,
"autoPauseDelay": 80
}
}
}
},
"202": {
"headers": {
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2023-05-01"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "sqlcrudtest-2369",
"serverName": "sqlcrudtest-8069",
"elasticPoolName": "sqlcrudtest-8102",
"api-version": "2023-05-01-preview",
"parameters": {
"sku": {
"name": "GP_S_Gen5_2",
"tier": "GeneralPurpose",
"capacity": 2
},
"properties": {
"minCapacity": 0.5,
"autoPauseDelay": 60,
"perDatabaseSettings": {
"minCapacity": 0,
"maxCapacity": 2.0,
"autoPauseDelay": 80
}
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"location": "Japan East",
"kind": null,
"sku": {
"name": "GP_S_Gen5_2",
"tier": "GeneralPurpose",
"capacity": 2
},
"properties": {
"creationDate": "2017-02-10T01:25:25.033Z",
"state": "Ready",
"maxSizeBytes": 102400,
"minCapacity": 0.5,
"autoPauseDelay": 60,
"perDatabaseSettings": {
"minCapacity": 0,
"maxCapacity": 2.0,
"autoPauseDelay": 80
}
}
}
},
"202": {
"headers": {
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2023-05-01"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "sqlcrudtest-2369",
"serverName": "sqlcrudtest-8069",
"elasticPoolName": "sqlcrudtest-8102",
"api-version": "2023-05-01-preview"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"location": "Japan East",
"kind": null,
"sku": {
"name": "GP_S_Gen5_2",
"tier": "GeneralPurpose",
"capacity": 2
},
"properties": {
"creationDate": "2017-10-10T01:25:25.033Z",
"state": "Ready",
"maxSizeBytes": 5242880000,
"minCapacity": 0.5,
"autoPauseDelay": 60,
"perDatabaseSettings": {
"minCapacity": 0,
"maxCapacity": 1.0,
"autoPauseDelay": 60
},
"zoneRedundant": true,
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"
}
}
}
}
}

0 comments on commit 0db53b9

Please sign in to comment.