diff --git a/specification/iotoperations/IoTOperations.Management/eng/openapi-script.sh b/specification/iotoperations/IoTOperations.Management/eng/openapi-script.sh index b481bff9a4f5..b0454adf732b 100755 --- a/specification/iotoperations/IoTOperations.Management/eng/openapi-script.sh +++ b/specification/iotoperations/IoTOperations.Management/eng/openapi-script.sh @@ -11,9 +11,9 @@ pushd "$script_dir/../.." || { exit 1 } -echo "Deleting the examples in the resource-manager directory and the management directory..." -rm -r resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples -rm -r IoTOperations.Management/examples/2024-08-15-preview +# echo "Deleting the examples in the resource-manager directory and the management directory..." +# rm -r resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples +# rm -r IoTOperations.Management/examples/2024-08-15-preview echo "Generating the specs and the examples!" @@ -22,62 +22,68 @@ echo "Compiling the typespecs in the iotoperations directory..." npx tsp compile IoTOperations.Management/. # Generate examples for all the openapi specs -echo "Generating examples for all the openapi specs..." -oav generate-examples resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/iotoperations.json --max -p +# echo "Generating examples for all the openapi specs..." +# oav generate-examples resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/iotoperations.json --max -p # Search each example file and replace the default string with resource-name123 -for file in resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/*.json; do - jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp ^[a-z0-9][a-z0-9-]*[a-z0-9]$" then "resource-name123" else . end)' $file > temp.json && mv temp.json $file - jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp ^[0-9]+[KMGTPE]$" then "500M" else . end)' $file > temp.json && mv temp.json $file - jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp ^https://.*$" then "https://www.example.com" else . end)' $file > temp.json && mv temp.json $file - jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp .+\\..+\\.kusto\\.windows\\.net" then "..kusto.windows.net" else . end)' $file > temp.json && mv temp.json $file - jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp .+\\.blob\\.core\\.windows\\.net" then ".blob.core.windows.net" else . end)' $file > temp.json && mv temp.json $file - jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp .+\\.fabric\\.microsoft\\.com" then "https://.fabric.microsoft.com" else . end)' $file > temp.json && mv temp.json $file -done - -for file in resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/*.json; do - - # The following Jq commands replace ids with properly formatted ARM Ids - operationId=$(jq -r '.operationId' $file) - if [[ $operationId == Instance* ]]; then - jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("Instance") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file - elif [[ $operationId == BrokerAuthentication* ]]; then - jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("BrokerAuthentication") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file - elif [[ $operationId == BrokerAuthorization* ]]; then - jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("BrokerAuthorization") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file - elif [[ $operationId == BrokerListener* ]]; then - jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("BrokerListener") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file - elif [[ $operationId == Broker* ]]; then - jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("Broker") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file - elif [[ $operationId == DataflowProfile* ]]; then - jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("DataflowProfile") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file - elif [[ $operationId == DataflowEndpoint* ]]; then - jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("DataflowEndpoint") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file - elif [[ $operationId == Dataflow* ]]; then - jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("Dataflow") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file - fi - - # The following Jq command chops down numbers that are greater than 10000 to 10000, the OAV generate examples tool will not respect the min/max value required by typespec - jq 'walk(if type == "number" then . % 10000 else . end)' $file > temp.json && mv temp.json $file - - # Set spanChannelCapacity to correct value for minimum. - jq 'walk(if type == "object" and .spanChannelCapacity? then .spanChannelCapacity = 1000 else . end)' $file > temp.json && mv temp.json $file - - # Replace description strings with some Lorem Ipsum text. - jq 'walk(if type == "object" and .description? then .description = "Lorem ipsum odor amet, consectetuer adipiscing elit." else . end)' $file > temp.json && mv temp.json $file - - # Replace identity strings with GUIDs. - jq 'walk(if type == "object" and .principalId? then .principalId = "4a6e4195-75b8-4685-aa0c-0b5704779327" else . end)' $file > temp.json && mv temp.json $file - jq 'walk(if type == "object" and .tenantId? then .tenantId = "ed060aa2-71ff-4d3f-99c4-a9138356fdec" else . end)' $file > temp.json && mv temp.json $file - jq 'walk(if type == "object" and .clientId? then .clientId = "fb90f267-8872-431a-a76a-a1cec5d3c4d2" else . end)' $file > temp.json && mv temp.json $file -done + +##################################################################### +# +# Don't make any changes to examples for now through this script. +# +##################################################################### +# for file in resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/*.json; do +# jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp ^[a-z0-9][a-z0-9-]*[a-z0-9]$" then "resource-name123" else . end)' $file > temp.json && mv temp.json $file +# jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp ^[0-9]+[KMGTPE]$" then "500M" else . end)' $file > temp.json && mv temp.json $file +# jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp ^https://.*$" then "https://www.example.com" else . end)' $file > temp.json && mv temp.json $file +# jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp .+\\..+\\.kusto\\.windows\\.net" then "..kusto.windows.net" else . end)' $file > temp.json && mv temp.json $file +# jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp .+\\.blob\\.core\\.windows\\.net" then ".blob.core.windows.net" else . end)' $file > temp.json && mv temp.json $file +# jq 'walk(if type == "string" and . == "Replace this value with a string matching RegExp .+\\.fabric\\.microsoft\\.com" then "https://.fabric.microsoft.com" else . end)' $file > temp.json && mv temp.json $file +# done + +# for file in resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/*.json; do + +# # The following Jq commands replace ids with properly formatted ARM Ids +# operationId=$(jq -r '.operationId' $file) +# if [[ $operationId == Instance* ]]; then +# jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("Instance") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file +# elif [[ $operationId == BrokerAuthentication* ]]; then +# jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("BrokerAuthentication") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file +# elif [[ $operationId == BrokerAuthorization* ]]; then +# jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("BrokerAuthorization") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file +# elif [[ $operationId == BrokerListener* ]]; then +# jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("BrokerListener") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file +# elif [[ $operationId == Broker* ]]; then +# jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("Broker") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file +# elif [[ $operationId == DataflowProfile* ]]; then +# jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("DataflowProfile") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file +# elif [[ $operationId == DataflowEndpoint* ]]; then +# jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("DataflowEndpoint") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file +# elif [[ $operationId == Dataflow* ]]; then +# jq --arg operationId "$operationId" 'walk(if type == "object" and .id? then if $operationId | startswith("Dataflow") then .id = "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" else . end else . end)' $file > temp.json && mv temp.json $file +# fi + +# # The following Jq command chops down numbers that are greater than 10000 to 10000, the OAV generate examples tool will not respect the min/max value required by typespec +# jq 'walk(if type == "number" then . % 10000 else . end)' $file > temp.json && mv temp.json $file + +# # Set spanChannelCapacity to correct value for minimum. +# jq 'walk(if type == "object" and .spanChannelCapacity? then .spanChannelCapacity = 1000 else . end)' $file > temp.json && mv temp.json $file + +# # Replace description strings with some Lorem Ipsum text. +# jq 'walk(if type == "object" and .description? then .description = "Lorem ipsum odor amet, consectetuer adipiscing elit." else . end)' $file > temp.json && mv temp.json $file + +# # Replace identity strings with GUIDs. +# jq 'walk(if type == "object" and .principalId? then .principalId = "4a6e4195-75b8-4685-aa0c-0b5704779327" else . end)' $file > temp.json && mv temp.json $file +# jq 'walk(if type == "object" and .tenantId? then .tenantId = "ed060aa2-71ff-4d3f-99c4-a9138356fdec" else . end)' $file > temp.json && mv temp.json $file +# jq 'walk(if type == "object" and .clientId? then .clientId = "fb90f267-8872-431a-a76a-a1cec5d3c4d2" else . end)' $file > temp.json && mv temp.json $file +# done # Copy the examples to the management directory -echo "Copying the examples to the management directory..." -cp -r resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/. IoTOperations.Management/examples/2024-08-15-preview/ +# echo "Copying the examples to the management directory..." +# cp -r resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/. IoTOperations.Management/examples/2024-08-15-preview/ # Recompile the typespecs in the management directory -echo "Recompiling the typespecs in the management directory..." +# echo "Recompiling the typespecs in the management directory..." npx tsp compile IoTOperations.Management/. npx tsv IoTOperations.Management/. diff --git a/specification/iotoperations/IoTOperations.Management/examples/2024-08-15-preview/BrokerListener_CreateOrUpdate_Simple.json b/specification/iotoperations/IoTOperations.Management/examples/2024-08-15-preview/BrokerListener_CreateOrUpdate_Simple.json index 8b6362ea91e4..9ea8ac02ee86 100644 --- a/specification/iotoperations/IoTOperations.Management/examples/2024-08-15-preview/BrokerListener_CreateOrUpdate_Simple.json +++ b/specification/iotoperations/IoTOperations.Management/examples/2024-08-15-preview/BrokerListener_CreateOrUpdate_Simple.json @@ -1,5 +1,5 @@ { - "title": "BrokerListener_CreateOrUpdate_Complex", + "title": "BrokerListener_CreateOrUpdate_Simple", "operationId": "BrokerListener_CreateOrUpdate", "parameters": { "api-version": "2024-08-15-preview", diff --git a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerAuthentication_CreateOrUpdate_Complex.json b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerAuthentication_CreateOrUpdate_Complex.json new file mode 100644 index 000000000000..f7578adb40ee --- /dev/null +++ b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerAuthentication_CreateOrUpdate_Complex.json @@ -0,0 +1,57 @@ +{ + "title": "BrokerAuthentication_CreateOrUpdate_Complex", + "operationId": "BrokerAuthentication_CreateOrUpdate", + "parameters": { + "api-version": "2024-08-15-preview", + "subscriptionId": "F8C729F9-DF9C-4743-848F-96EE433D8E53", + "resourceGroupName": "rgiotoperations", + "instanceName": "resource-name123", + "brokerName": "resource-name123", + "authenticationName": "resource-name123", + "resource": { + "properties": { + "authenticationMethods": [ + { + "method": "ServiceAccountToken", + "serviceAccountTokenSettings": { + "audiences": [ + "aio-mq" + ] + } + }, + { + "method": "X509", + "x509Settings": { + "trustedClientCaCert": "my-ca", + "authorizationAttributes": { + "root": { + "subject": "CN = Contoso Root CA Cert, OU = Engineering, C = US", + "attributes": { + "organization": "contoso" + } + }, + "intermediate": { + "subject": "CN = Contoso Intermediate CA", + "attributes": { + "city": "seattle", + "foo": "bar" + } + }, + "smart-fan": { + "subject": "CN = smart-fan", + "attributes": { + "building": "17" + } + } + } + } + } + ] + }, + "extendedLocation": { + "name": "qmbrfwcpwwhggszhrdjv", + "type": "CustomLocation" + } + } + } +} diff --git a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerAuthorization_CreateOrUpdate_Complex.json b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerAuthorization_CreateOrUpdate_Complex.json new file mode 100644 index 000000000000..d7641c68a027 --- /dev/null +++ b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerAuthorization_CreateOrUpdate_Complex.json @@ -0,0 +1,78 @@ +{ + "title": "BrokerAuthorization_CreateOrUpdate_Complex", + "operationId": "BrokerAuthorization_CreateOrUpdate", + "parameters": { + "api-version": "2024-08-15-preview", + "subscriptionId": "F8C729F9-DF9C-4743-848F-96EE433D8E53", + "resourceGroupName": "rgiotoperations", + "instanceName": "resource-name123", + "brokerName": "resource-name123", + "authorizationName": "resource-name123", + "resource": { + "properties": { + "authorizationPolicies": { + "enableCache": true, + "rules": [ + { + "principals": { + "usernames": [ + "temperature-sensor", + "humidity-sensor" + ], + "attributes": [ + { + "building": 17, + "organization": "contoso" + } + ] + }, + "brokerResources": [ + { + "method": "Connect", + "clientIds": [ + "{principal.attributes.building}*" + ] + }, + { + "method": "Publish", + "topics": [ + "sensors/{principal.attributes.building}/{principal.clientId}/telemetry/*" + ] + }, + { + "method": "Subscribe", + "topics": [ + "commands/{principal.attributes.organization}" + ] + } + ], + "stateStoreResources": [ + { + "method": "Read", + "keyType": "Pattern", + "keys": [ + "myreadkey", + "myotherkey?", + "mynumerickeysuffix[0-9]", + "clients:{principal.clientId}:*" + ] + }, + { + "method": "ReadWrite", + "keyType": "Binary", + "keys": [ + "MTE2IDEwMSAxMTUgMTE2" + ] + } + ] + } + ] + } + }, + "extendedLocation": { + "name": "qmbrfwcpwwhggszhrdjv", + "type": "CustomLocation" + } + } + } +} diff --git a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerAuthorization_CreateOrUpdate_Simple.json b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerAuthorization_CreateOrUpdate_Simple.json new file mode 100644 index 000000000000..199c608d8af1 --- /dev/null +++ b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerAuthorization_CreateOrUpdate_Simple.json @@ -0,0 +1,59 @@ +{ + "title": "BrokerAuthorization_CreateOrUpdate_Simple", + "operationId": "BrokerAuthorization_CreateOrUpdate", + "parameters": { + "api-version": "2024-08-15-preview", + "subscriptionId": "F8C729F9-DF9C-4743-848F-96EE433D8E53", + "resourceGroupName": "rgiotoperations", + "instanceName": "resource-name123", + "brokerName": "resource-name123", + "authorizationName": "resource-name123", + "resource": { + "properties": { + "authorizationPolicies": { + "enableCache": true, + "rules": [ + { + "principals": { + "clientIds": [ + "my-client-id" + ], + "attributes": [ + { + "floor": "floor1", + "site": "site1" + } + ] + }, + "brokerResources": [ + { + "method": "Connect" + }, + { + "method": "Subscribe", + "topics": [ + "topic", + "topic/with/wildcard/#" + ] + } + ], + "stateStoreResources": [ + { + "method": "ReadWrite", + "keyType": "Pattern", + "keys": [ + "*" + ] + } + ] + } + ] + } + }, + "extendedLocation": { + "name": "qmbrfwcpwwhggszhrdjv", + "type": "CustomLocation" + } + } + } +} diff --git a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerListener_CreateOrUpdate_Complex.json b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerListener_CreateOrUpdate_Complex.json new file mode 100644 index 000000000000..e1aa5cf386f1 --- /dev/null +++ b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerListener_CreateOrUpdate_Complex.json @@ -0,0 +1,56 @@ +{ + "title": "BrokerListener_CreateOrUpdate_Complex", + "operationId": "BrokerListener_CreateOrUpdate", + "parameters": { + "api-version": "2024-08-15-preview", + "subscriptionId": "F8C729F9-DF9C-4743-848F-96EE433D8E53", + "resourceGroupName": "rgiotoperations", + "instanceName": "resource-name123", + "brokerName": "resource-name123", + "listenerName": "resource-name123", + "resource": { + "properties": { + "serviceType": "LoadBalancer", + "ports": [ + { + "port": 8080, + "authenticationRef": "example-authentication", + "protocol": "WebSockets" + }, + { + "port": 8443, + "authenticationRef": "example-authentication", + "protocol": "WebSockets", + "tls": { + "mode": "Automatic", + "certManagerCertificateSpec": { + "issuerRef": { + "name": "example-issuer", + "kind": "Issuer" + } + } + } + }, + { + "port": 1883, + "authenticationRef": "example-authentication" + }, + { + "port": 8883, + "authenticationRef": "example-authentication", + "tls": { + "mode": "Manual", + "manual": { + "secretRef": "example-secret" + } + } + } + ] + }, + "extendedLocation": { + "name": "qmbrfwcpwwhggszhrdjv", + "type": "CustomLocation" + } + } + } +} diff --git a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerListener_CreateOrUpdate_Simple.json b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerListener_CreateOrUpdate_Simple.json new file mode 100644 index 000000000000..9ea8ac02ee86 --- /dev/null +++ b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/BrokerListener_CreateOrUpdate_Simple.json @@ -0,0 +1,25 @@ +{ + "title": "BrokerListener_CreateOrUpdate_Simple", + "operationId": "BrokerListener_CreateOrUpdate", + "parameters": { + "api-version": "2024-08-15-preview", + "subscriptionId": "F8C729F9-DF9C-4743-848F-96EE433D8E53", + "resourceGroupName": "rgiotoperations", + "instanceName": "resource-name123", + "brokerName": "resource-name123", + "listenerName": "resource-name123", + "resource": { + "properties": { + "ports": [ + { + "port": 1883 + } + ] + }, + "extendedLocation": { + "name": "qmbrfwcpwwhggszhrdjv", + "type": "CustomLocation" + } + } + } +} diff --git a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/Broker_CreateOrUpdate_Complex.json b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/Broker_CreateOrUpdate_Complex.json new file mode 100644 index 000000000000..3ff18835db3b --- /dev/null +++ b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/Broker_CreateOrUpdate_Complex.json @@ -0,0 +1,37 @@ +{ + "title": "Broker_CreateOrUpdate_Complex", + "operationId": "Broker_CreateOrUpdate", + "parameters": { + "api-version": "2024-08-15-preview", + "subscriptionId": "F8C729F9-DF9C-4743-848F-96EE433D8E53", + "resourceGroupName": "rgiotoperations", + "instanceName": "resource-name123", + "brokerName": "resource-name123", + "resource": { + "properties": { + "cardinality": { + "backendChain": { + "partitions": 2, + "redundancyFactor": 2, + "workers": 2 + }, + "frontend": { + "replicas": 2, + "workers": 2 + } + }, + "diskBackedMessageBuffer": { + "maxSize": "50M" + }, + "generateResourceLimits": { + "cpu": "Enabled" + }, + "memoryProfile": "Medium" + }, + "extendedLocation": { + "name": "qmbrfwcpwwhggszhrdjv", + "type": "CustomLocation" + } + } + } +} diff --git a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/Broker_CreateOrUpdate_Minimal.json b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/Broker_CreateOrUpdate_Minimal.json new file mode 100644 index 000000000000..941cddf821ea --- /dev/null +++ b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/Broker_CreateOrUpdate_Minimal.json @@ -0,0 +1,20 @@ +{ + "title": "Broker_CreateOrUpdate_Minimal", + "operationId": "Broker_CreateOrUpdate", + "parameters": { + "api-version": "2024-08-15-preview", + "subscriptionId": "F8C729F9-DF9C-4743-848F-96EE433D8E53", + "resourceGroupName": "rgiotoperations", + "instanceName": "resource-name123", + "brokerName": "resource-name123", + "resource": { + "properties": { + "memoryProfile": "Tiny" + }, + "extendedLocation": { + "name": "qmbrfwcpwwhggszhrdjv", + "type": "CustomLocation" + } + } + } +} diff --git a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/Broker_CreateOrUpdate_Simple.json b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/Broker_CreateOrUpdate_Simple.json new file mode 100644 index 000000000000..4eda7db01d32 --- /dev/null +++ b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/examples/Broker_CreateOrUpdate_Simple.json @@ -0,0 +1,34 @@ +{ + "title": "Broker_CreateOrUpdate_Simple", + "operationId": "Broker_CreateOrUpdate", + "parameters": { + "api-version": "2024-08-15-preview", + "subscriptionId": "F8C729F9-DF9C-4743-848F-96EE433D8E53", + "resourceGroupName": "rgiotoperations", + "instanceName": "resource-name123", + "brokerName": "resource-name123", + "resource": { + "properties": { + "cardinality": { + "backendChain": { + "partitions": 2, + "redundancyFactor": 2, + "workers": 2 + }, + "frontend": { + "replicas": 2, + "workers": 2 + } + }, + "generateResourceLimits": { + "cpu": "Enabled" + }, + "memoryProfile": "Low" + }, + "extendedLocation": { + "name": "qmbrfwcpwwhggszhrdjv", + "type": "CustomLocation" + } + } + } +} diff --git a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/iotoperations.json b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/iotoperations.json index 49495366a2ba..fa1d5961b590 100644 --- a/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/iotoperations.json +++ b/specification/iotoperations/resource-manager/Microsoft.IoTOperations/preview/2024-08-15-preview/iotoperations.json @@ -619,6 +619,15 @@ "x-ms-examples": { "Broker_CreateOrUpdate": { "$ref": "./examples/Broker_CreateOrUpdate_MaximumSet_Gen.json" + }, + "Broker_CreateOrUpdate_Complex": { + "$ref": "./examples/Broker_CreateOrUpdate_Complex.json" + }, + "Broker_CreateOrUpdate_Minimal": { + "$ref": "./examples/Broker_CreateOrUpdate_Minimal.json" + }, + "Broker_CreateOrUpdate_Simple": { + "$ref": "./examples/Broker_CreateOrUpdate_Simple.json" } }, "x-ms-long-running-operation-options": { @@ -919,6 +928,9 @@ "x-ms-examples": { "BrokerAuthentication_CreateOrUpdate": { "$ref": "./examples/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json" + }, + "BrokerAuthentication_CreateOrUpdate_Complex": { + "$ref": "./examples/BrokerAuthentication_CreateOrUpdate_Complex.json" } }, "x-ms-long-running-operation-options": { @@ -1229,6 +1241,12 @@ "x-ms-examples": { "BrokerAuthorization_CreateOrUpdate": { "$ref": "./examples/BrokerAuthorization_CreateOrUpdate_MaximumSet_Gen.json" + }, + "BrokerAuthorization_CreateOrUpdate_Complex": { + "$ref": "./examples/BrokerAuthorization_CreateOrUpdate_Complex.json" + }, + "BrokerAuthorization_CreateOrUpdate_Simple": { + "$ref": "./examples/BrokerAuthorization_CreateOrUpdate_Simple.json" } }, "x-ms-long-running-operation-options": { @@ -1539,6 +1557,12 @@ "x-ms-examples": { "BrokerListener_CreateOrUpdate": { "$ref": "./examples/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json" + }, + "BrokerListener_CreateOrUpdate_Complex": { + "$ref": "./examples/BrokerListener_CreateOrUpdate_Complex.json" + }, + "BrokerListener_CreateOrUpdate_Simple": { + "$ref": "./examples/BrokerListener_CreateOrUpdate_Simple.json" } }, "x-ms-long-running-operation-options": {