Skip to content

Commit

Permalink
Add Swagger and Examples for custom resource provider to Azure (#5808)
Browse files Browse the repository at this point in the history
* Add Swagger and Examples for custom resource provider to Azure

* Apply suggestions from code review

Fix typos in strings for RP.

Co-Authored-By: jjbfour <jobreen@microsoft.com>
  • Loading branch information
jjbfour authored and kpajdzik committed Apr 30, 2019
1 parent b218071 commit 8131327
Show file tree
Hide file tree
Showing 15 changed files with 1,222 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"parameters": {
"resourceProviderName": "newrp",
"resourceGroupName": "testRG",
"api-version": "2018-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceProvider": {
"location": "eastus",
"properties": {
"actions": [
{
"name": "TestAction",
"routingType": "Proxy",
"endpoint": "https://mytestendpoint/"
}
],
"resourceTypes": [
{
"name": "TestResource",
"routingType": "Proxy,Cache",
"endpoint": "https://mytestendpoint2/"
}
]
}
}
},
"responses": {
"201": {
"body": {
"name": "newrp",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp",
"type": "Microsoft.CustomProviders/resourceProviders",
"location": "East US",
"properties": {
"provisioningState": "Accepted",
"actions": [
{
"name": "TestAction",
"routingType": "Proxy",
"endpoint": "https://mytestendpoint/"
}
],
"resourceTypes": [
{
"name": "TestResource",
"routingType": "Proxy,Cache",
"endpoint": "https://mytestendpoint2/"
}
]
}
}
},
"200": {
"body": {
"name": "newrp",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp",
"type": "Microsoft.CustomProviders/resourceProviders",
"location": "East US",
"properties": {
"provisioningState": "Accepted",
"actions": [
{
"name": "TestAction",
"routingType": "Proxy",
"endpoint": "https://mytestendpoint/"
}
],
"resourceTypes": [
{
"name": "TestResource",
"routingType": "Proxy,Cache",
"endpoint": "https://mytestendpoint2/"
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "testRG",
"resourceProviderName": "newrp",
"api-version": "2018-09-01-preview"
},
"responses": {
"200": {},
"202": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "testRG",
"resourceProviderName": "newrp",
"api-version": "2018-09-01-preview"
},
"responses": {
"200": {
"headers": {},
"body": {
"name": "newrp",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp",
"type": "Microsoft.CustomProviders/resourceProviders",
"location": "East US",
"properties": {
"provisioningState": "Succeeded",
"actions": [
{
"name": "TestAction",
"routingType": "Proxy",
"endpoint": "https://mytestendpoint/"
}
],
"resourceTypes": [
{
"name": "TestResource",
"routingType": "Proxy,Cache",
"endpoint": "https://mytestendpoint2/"
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "testRG",
"api-version": "2018-09-01-preview"
},
"responses": {
"200": {
"headers": {},
"body": {
"value": [
{
"name": "newrp1",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp1",
"type": "Microsoft.CustomProviders/resourceProviders",
"location": "East US",
"properties": {
"provisioningState": "Succeeded",
"actions": [
{
"name": "TestAction",
"routingType": "Proxy",
"endpoint": "https://mytestendpoint/"
}
],
"resourceTypes": [
{
"name": "TestResource",
"routingType": "Proxy,Cache",
"endpoint": "https://mytestendpoint2/"
}
]
}
},
{
"name": "newrp2",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp2",
"type": "Microsoft.CustomProviders/resourceProviders",
"location": "East US",
"properties": {
"provisioningState": "Succeeded",
"actions": [
{
"name": "TestAction",
"routingType": "Proxy",
"endpoint": "https://mytestendpoint/"
}
],
"resourceTypes": [
{
"name": "TestResource",
"routingType": "Proxy,Cache",
"endpoint": "https://mytestendpoint2/"
}
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"api-version": "2018-09-01-preview"
},
"responses": {
"200": {
"headers": {},
"body": {
"value": [
{
"name": "newrp1",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp1",
"type": "Microsoft.CustomProviders/resourceProviders",
"location": "East US",
"properties": {
"provisioningState": "Succeeded",
"actions": [
{
"name": "TestAction",
"routingType": "Proxy",
"endpoint": "https://mytestendpoint/"
}
],
"resourceTypes": [
{
"name": "TestResource",
"routingType": "Proxy,Cache",
"endpoint": "https://mytestendpoint2/"
}
]
}
},
{
"name": "newrp2",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG2/providers/Microsoft.CustomProviders/resourceProviders/newrp2",
"type": "Microsoft.CustomProviders/resourceProviders",
"location": "East US",
"properties": {
"provisioningState": "Succeeded",
"actions": [
{
"name": "TestAction",
"routingType": "Proxy",
"endpoint": "https://mytestendpoint/"
}
],
"resourceTypes": [
{
"name": "TestResource",
"routingType": "Proxy,Cache",
"endpoint": "https://mytestendpoint2/"
}
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"parameters": {
"api-version": "2018-09-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "Microsoft.CustomProviders/resourceProviders/read",
"display": {
"provider": "Azure Custom Providers",
"resource": "resourceProviders",
"operation": "List Custom Providers",
"description": "List or get the Custom Providers"
}
},
{
"name": "Microsoft.CustomProviders/resourceProviders/delete",
"display": {
"provider": "Azure Custom Providers",
"resource": "resourceProviders",
"operation": "List Custom Providers",
"description": "List or get the Custom Providers"
}
},
{
"name": "Microsoft.CustomProviders/resourceProviders/wrte",
"display": {
"provider": "Azure Custom Providers",
"resource": "resourceProviders",
"operation": "List Custom Providers",
"description": "List or get the Custom Providers"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"parameters": {
"resourceProviderName": "newrp",
"resourceGroupName": "testRG",
"api-version": "2018-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"patchableResource": {
"tags": {}
}
},
"responses": {
"200": {
"body": {
"name": "newrp",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp",
"type": "Microsoft.CustomProviders/resourceProviders",
"location": "East US",
"properties": {
"provisioningState": "Succeeded",
"actions": [
{
"name": "TestAction",
"routingType": "Proxy",
"endpoint": "https://mytestendpoint/"
}
],
"resourceTypes": [
{
"name": "TestResource",
"routingType": "Proxy,Cache",
"endpoint": "https://mytestendpoint2/"
}
]
}
}
}
}
}
15 changes: 15 additions & 0 deletions specification/customproviders/resource-manager/readme.csharp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## C

These settings apply only when `--csharp` is specified on the command line.
Please also specify `--csharp-sdks-folder=<path to "SDKs" directory of your azure-sdk-for-net clone>`.

```yaml $(csharp)
csharp:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 1
clear-output-folder: true
client-side-validation: false
namespace: Microsoft.CustomProviders
output-folder: $(csharp-sdks-folder)/customproviders/management/Microsoft.CustomProviders/GeneratedProtocol
```
19 changes: 19 additions & 0 deletions specification/customproviders/resource-manager/readme.go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Go

These settings apply only when `--go` is specified on the command line.

```yaml $(go)
go:
license-header: MICROSOFT_APACHE_NO_VERSION
namespace: customproviders
clear-output-folder: true
```
### Tag: package-2018-09-01-preview and go
These settings apply only when `--tag=package-2018-09-01-preview --go` is specified on the command line.
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.

```yaml $(tag) == 'package-2018-09-01-preview' && $(go)
output-folder: $(go-sdk-folder)/services/preview/$(namespace)/mgmt/2018-09-01-preview/$(namespace)
```
Loading

0 comments on commit 8131327

Please sign in to comment.