Skip to content

Commit

Permalink
Add new DevOps API swagger (#11836)
Browse files Browse the repository at this point in the history
* Add new DevOps API swagger

* Fix SDK error

* updating swagger version 2020-08-01-preview
  • Loading branch information
eswatad authored Dec 8, 2020
1 parent 877e69b commit 586c0f8
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 43 deletions.
8 changes: 4 additions & 4 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ changestate
CHECKACCESS
checkmark
checknameavailability
checkin
checkpointing
CIDR
CIDRs
Expand Down Expand Up @@ -1311,6 +1312,7 @@ privatepreview
projectable
propogation
Protectable
ProviderHub
provisioner
provisioningservices
provisioningState
Expand Down Expand Up @@ -1393,6 +1395,7 @@ regeneratekey
regeneratekeys
regexentities
regexes
regionality
regionalized
regionproposals
registeredidentities
Expand Down Expand Up @@ -1791,6 +1794,7 @@ tooltips
topqueries
topquery
TPEG
tpgs
traceback
traceparent
traceroute
Expand Down Expand Up @@ -2039,7 +2043,3 @@ ziplist
Zoho
zoneinfo
zset
tpgs
ProviderHub
checkin
regionality
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"application/json"
],
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditPolicyName}": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}": {
"get": {
"tags": [
"DevOpsAudit"
"ServerDevOpsAudit"
],
"description": "Gets a server's DevOps audit policy.",
"operationId": "ServerDevOpsAuditPolicies_Get",
"description": "Gets a server's DevOps audit settings.",
"operationId": "ServerDevOpsAuditSettings_Get",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
Expand All @@ -31,9 +31,9 @@
"$ref": "#/parameters/ServerNameParameter"
},
{
"name": "devOpsAuditPolicyName",
"name": "devOpsAuditingSettingsName",
"in": "path",
"description": "The name of the devops audit policy. This should always be 'default'.",
"description": "The name of the devops audit settings. This should always be 'default'.",
"required": true,
"type": "string"
},
Expand All @@ -46,27 +46,27 @@
],
"responses": {
"200": {
"description": "Successfully retrieved the server DevOps audit policy.",
"description": "Successfully retrieved the server DevOps audit settings.",
"schema": {
"$ref": "#/definitions/ServerDevOpsAuditingPolicy"
"$ref": "#/definitions/ServerDevOpsAuditingSettings"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription."
}
},
"x-ms-examples": {
"Get a server's DevOps audit policy": {
"Get a server's DevOps audit settings": {
"$ref": "./examples/ServerDevOpsAuditGet.json"
}
}
},
"put": {
"tags": [
"DevOpsAudit"
"ServerDevOpsAudit"
],
"description": "Creates or updates a server's DevOps audit policy.",
"operationId": "ServerDevOpsAuditPolicies_CreateOrUpdate",
"description": "Creates or updates a server's DevOps audit settings.",
"operationId": "ServerDevOpsAuditSettings_CreateOrUpdate",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
Expand All @@ -75,19 +75,19 @@
"$ref": "#/parameters/ServerNameParameter"
},
{
"name": "devOpsAuditPolicyName",
"name": "devOpsAuditingSettingsName",
"in": "path",
"description": "The name of the devops audit policy. This should always be 'default'.",
"description": "The name of the devops audit settings. This should always be 'default'.",
"required": true,
"type": "string"
},
{
"name": "parameters",
"in": "body",
"description": "Properties of DevOps audit policy",
"description": "Properties of DevOps audit settings",
"required": true,
"schema": {
"$ref": "#/definitions/ServerDevOpsAuditingPolicy"
"$ref": "#/definitions/ServerDevOpsAuditingSettings"
}
},
{
Expand All @@ -101,22 +101,25 @@
"200": {
"description": "Successfully updated the DevOps audit settings.",
"schema": {
"$ref": "#/definitions/ServerDevOpsAuditingPolicy"
"$ref": "#/definitions/ServerDevOpsAuditingSettings"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 InvalidServerDevOpsAuditPolicyCreateRequest - The create server DevOps audit policy request does not exist or has no properties object.\n\n * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.\n\n * 400 DevOpsAuditInvalidStorageAccountCredentials - The provided storage account or access key is not valid.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 409 ServerDevOpsAuditPolicyInProgress - Set server DevOps audit is already in progress."
"description": "*** Error Responses: ***\n\n * 400 InvalidServerDevOpsAuditSettingsCreateRequest - \n\n * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.\n\n * 400 DevOpsAuditInvalidStorageAccountCredentials - The provided storage account or access key is not valid.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 409 ServerDevOpsAuditSettingsInProgress - "
},
"202": {
"description": "Updating the audit DevOps settings is in progress."
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "azure-async-operation"
},
"x-ms-examples": {
"Update a server's DevOps audit policy with minimal input": {
"Update a server's DevOps audit settings with minimal input": {
"$ref": "./examples/ServerDevOpsAuditCreateMin.json"
},
"Update a server's DevOps audit policy with all params": {
"Update a server's DevOps audit settings with all params": {
"$ref": "./examples/ServerDevOpsAuditCreateMax.json"
}
}
Expand All @@ -125,10 +128,10 @@
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings": {
"get": {
"tags": [
"DevOpsAudit"
"ServerDevOpsAudit"
],
"description": "Lists DevOps audit settings of a server.",
"operationId": "ServerDevOpsAuditPolicies_ListByServer",
"operationId": "ServerDevOpsAuditSettings_ListByServer",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
Expand All @@ -147,7 +150,7 @@
"200": {
"description": "Successfully retrieved server DevOps audit settings.",
"schema": {
"$ref": "#/definitions/ServerDevOpsAuditingPolicyListResult"
"$ref": "#/definitions/ServerDevOpsAuditSettingsListResult"
}
},
"default": {
Expand All @@ -166,8 +169,8 @@
}
},
"definitions": {
"ServerDevOpsAuditPolicyProperties": {
"description": "Properties of a server DevOps audit policy.",
"ServerDevOpsAuditSettingsProperties": {
"description": "Properties of a server DevOps audit settings.",
"required": [
"state"
],
Expand All @@ -178,7 +181,7 @@
"type": "boolean"
},
"state": {
"description": "Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.",
"description": "Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.",
"enum": [
"Enabled",
"Disabled"
Expand All @@ -196,6 +199,7 @@
"storageAccountAccessKey": {
"description": "Specifies the identifier key of the auditing storage account. \r\nIf state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.\r\nPrerequisites for using managed identity authentication:\r\n1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).\r\n2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.\r\nFor more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)",
"type": "string",
"x-ms-secret": true,
"x-ms-mutability": [
"create",
"update"
Expand All @@ -208,31 +212,36 @@
}
}
},
"ServerDevOpsAuditingPolicy": {
"description": "A server DevOps auditing policy.",
"ServerDevOpsAuditingSettings": {
"description": "A server DevOps auditing settings.",
"type": "object",
"allOf": [
{
"$ref": "../../../common/v1/types.json#/definitions/ProxyResource"
}
],
"properties": {
"systemData": {
"$ref": "../../../common/v1/types.json#/definitions/systemData",
"description": "SystemData of ServerDevOpsAuditSettingsResource.",
"readOnly": true
},
"properties": {
"$ref": "#/definitions/ServerDevOpsAuditPolicyProperties",
"$ref": "#/definitions/ServerDevOpsAuditSettingsProperties",
"description": "Resource properties.",
"x-ms-client-flatten": true
}
}
},
"ServerDevOpsAuditingPolicyListResult": {
"ServerDevOpsAuditSettingsListResult": {
"description": "A list of server DevOps audit settings.",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/ServerDevOpsAuditingPolicy"
"$ref": "#/definitions/ServerDevOpsAuditingSettings"
},
"readOnly": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "devAuditTestRG",
"serverName": "devOpsAuditTestSvr",
"devOpsAuditPolicyName": "default",
"devOpsAuditingSettingsName": "default",
"api-version": "2020-08-01-preview",
"parameters": {
"properties": {
Expand Down Expand Up @@ -31,7 +31,7 @@
},
"202": {
"startTime": "2020-09-22T09:34:54.72Z",
"operation": "UpsertServerDevOpsAuditPolicy"
"operation": "UpsertServerDevOpsAuditingSettings"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "devAuditTestRG",
"serverName": "devOpsAuditTestSvr",
"devOpsAuditPolicyName": "default",
"devOpsAuditingSettingsName": "default",
"api-version": "2020-08-01-preview",
"parameters": {
"properties": {
Expand All @@ -28,7 +28,7 @@
},
"202": {
"startTime": "2020-09-09T09:34:54.72Z",
"operation": "UpsertServerEngineAuditingPolicy"
"operation": "UpsertServerDevOpsAuditingSettings"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "devAuditTestRG",
"serverName": "devOpsAuditTestSvr",
"DevOpsAuditPolicyName": "default",
"api-version": "2020-08-01-preview",
"devOpsAuditPolicyName": "default"
"devOpsAuditingSettingsName": "default",
"api-version": "2020-08-01-preview"
},
"responses": {
"200": {
Expand Down
58 changes: 58 additions & 0 deletions specification/sql/resource-manager/common/v1/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,64 @@
}
}
},
"systemData": {
"description": "Metadata pertaining to creation and last modification of the resource.",
"type": "object",
"properties": {
"createdBy": {
"description": "A string identifier for the identity that created the resource.",
"type": "string",
"readOnly": true
},
"createdByType": {
"description": "The type of identity that created the resource: <User|Application|ManagedIdentity|Key>",
"enum": [
"User",
"Application",
"ManagedIdentity",
"Key"
],
"type": "string",
"readOnly": true,
"x-ms-enum": {
"name": "createdByType",
"modelAsString": true
}
},
"createdAt": {
"format": "date-time",
"description": "The timestamp of resource creation (UTC).",
"type": "string",
"readOnly": true
},
"lastModifiedBy": {
"description": "A string identifier for the identity that last modified the resource.",
"type": "string",
"readOnly": true
},
"lastModifiedByType": {
"description": "The type of identity that last modified the resource: <User|Application|ManagedIdentity|Key>",
"enum": [
"User",
"Application",
"ManagedIdentity",
"Key"
],
"type": "string",
"readOnly": true,
"x-ms-enum": {
"name": "createdByType",
"modelAsString": true
}
},
"lastModifiedAt": {
"format": "date-time",
"description": "The timestamp of last modification (UTC).",
"type": "string",
"readOnly": true
}
}
},
"ResourceIdentity": {
"description": "Azure Active Directory identity configuration for a resource.",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion specification/sql/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ input-file:
- Microsoft.Sql/preview/2020-02-02-preview/ServerTrustGroups.json
- Microsoft.Sql/preview/2020-08-01-preview/Databases.json
- Microsoft.Sql/preview/2020-08-01-preview/ElasticPools.json
- Microsoft.Sql/preview/2020-08-01-preview/ServerDevOpsAudit.json
# Needed when there is more than one input file
Expand Down Expand Up @@ -614,7 +615,6 @@ input-file:
- ./Microsoft.Sql/preview/2020-08-01-preview/DatabaseVulnerabilityAssessmentScans.json
- ./Microsoft.Sql/preview/2020-08-01-preview/DataWarehouseUserActivities.json
- ./Microsoft.Sql/preview/2020-08-01-preview/DeletedServers.json
- ./Microsoft.Sql/preview/2020-08-01-preview/DevOpsAudit.json
- ./Microsoft.Sql/preview/2020-08-01-preview/ElasticPoolOperations.json
- ./Microsoft.Sql/preview/2020-08-01-preview/ElasticPools.json
- ./Microsoft.Sql/preview/2020-08-01-preview/EncryptionProtectors.json
Expand Down

0 comments on commit 586c0f8

Please sign in to comment.