From 0994ebaec34bcbca98120cd7857913b8ced1b06e Mon Sep 17 00:00:00 2001 From: Zim Kalinowski Date: Tue, 6 Aug 2019 17:25:28 +0800 Subject: [PATCH] autogenerated-apimanagementapidiagnostic (#87) * autogenerated-apimanagementapidiagnostic * autogenerated-apimanagementapidiagnostic * enable code gen for api mgmt diagnostic. * remove resources.json * add listing resources script * testing the script * testing script once more * print the mmspecs' branches in pipeline * print the branches * try diff branches once more * listing resources script works well now * add fallback in script * test the script * successful test for script, remove test codes * fix minor logic error --- Makefile | 4 +- azure-pipelines.yml | 2 +- list_resources.sh | 23 +- resources.json | 3 - specs/apimanagementapidiagnostic/ansible.yaml | 6 + specs/apimanagementapidiagnostic/api.yaml | 838 ++++++++++++++++++ ...gement_service_apis_diagnostics_delete.yml | 11 + ...agement_service_apis_diagnostics_patch.yml | 37 + ...anagement_service_apis_diagnostics_put.yml | 37 + .../apimanagementapidiagnostic/terraform.yaml | 4 + 10 files changed, 955 insertions(+), 10 deletions(-) delete mode 100644 resources.json create mode 100644 specs/apimanagementapidiagnostic/ansible.yaml create mode 100644 specs/apimanagementapidiagnostic/api.yaml create mode 100644 specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_delete.yml create mode 100644 specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_patch.yml create mode 100644 specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_put.yml create mode 100644 specs/apimanagementapidiagnostic/terraform.yaml diff --git a/Makefile b/Makefile index f289a28..cd0c14f 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ build-terraform: @if [ -z "$(RESOURCE)" ]; then \ echo "==> Generating source code for terraform from resource list..."; \ cd $(MMROOT) && \ - sh $(ROOT)/list_resources.sh | xargs -I '{}' bundle exec compiler -d -p $(SPECROOT)/'{}' -e terraform -c azure -o $(TFROOT)/$(TFREPO)/; \ + sh $(ROOT)/list_resources.sh $(SOURCE_BRANCH) | xargs -I '{}' bundle exec compiler -d -p $(SPECROOT)/'{}' -e terraform -c azure -o $(TFROOT)/$(TFREPO)/; \ else \ echo "==> Generating source code for terraform from given name..."; \ cd $(MMROOT) && \ @@ -71,7 +71,7 @@ build-ansible: @if [ -z "$(RESOURCE)" ]; then \ echo "==> Generating source code for ansible from resource list..."; \ cd $(MMROOT) && \ - sh $(ROOT)/list_resources.sh | xargs -I '{}' bundle exec compiler -d -p $(SPECROOT)/'{}' -e ansible -c azure -o $(GENROOT)/$(ASREPO)/; \ + sh $(ROOT)/list_resources.sh $(SOURCE_BRANCH) | xargs -I '{}' bundle exec compiler -d -p $(SPECROOT)/'{}' -e ansible -c azure -o $(GENROOT)/$(ASREPO)/; \ else \ echo "==> Generating source code for ansible from given name..."; \ cd $(MMROOT) && \ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 25ce52c..4d8d720 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,7 +79,7 @@ steps: failOnStderr: true - bash: | - make build && \ + make build SOURCE_BRANCH=$(System.PullRequest.SourceBranch) && \ make format-terraform displayName: 'code generation' failOnStderr: false diff --git a/list_resources.sh b/list_resources.sh index a2f4d5b..1303393 100644 --- a/list_resources.sh +++ b/list_resources.sh @@ -1,11 +1,26 @@ #!/bin/sh -cd `dirname $0` -for file in `ls ./specs`; do +cd $(dirname $0) + +# If Running Locally +source_branch=$1 +target_branch=master +if [ -z "$source_branch" ]; then + current_branch=$(git branch | grep '*') + source_branch="$(expr substr "$current_branch" 3 "${#current_branch}")" +fi + +# If Running in Pipeline +if [ -z "$(git branch | grep -E '[^/]'$source_branch)" ] || [ -z "$(git branch | grep -E '[^/]'$target_branch)" ]; then + source_branch=remotes/origin/$source_branch + target_branch=remotes/origin/$target_branch +fi + +# List Resource Directories +for file in $(ls ./specs); do work_dir=./specs/$file if [ -d $work_dir ]; then - if [ -n "$(git status -s $work_dir)" ]; - then + if [ -n "$(git diff --name-only $target_branch $source_branch -- $work_dir)" ]; then # remove the directory prefix './specs/' expr substr "$work_dir" 9 "${#work_dir}" fi diff --git a/resources.json b/resources.json deleted file mode 100644 index a24c6de..0000000 --- a/resources.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "apimanagementapirelease" -] diff --git a/specs/apimanagementapidiagnostic/ansible.yaml b/specs/apimanagementapidiagnostic/ansible.yaml new file mode 100644 index 0000000..39ce489 --- /dev/null +++ b/specs/apimanagementapidiagnostic/ansible.yaml @@ -0,0 +1,6 @@ +--- !ruby/object:Provider::Azure::Ansible::Config +author: audevbot +version_added: "2.9" +overrides: !ruby/object:Overrides::ResourceOverrides + ApiDiagnostic: !ruby/object:Provider::Azure::Ansible::ResourceOverride + examples: [] diff --git a/specs/apimanagementapidiagnostic/api.yaml b/specs/apimanagementapidiagnostic/api.yaml new file mode 100644 index 0000000..f707d60 --- /dev/null +++ b/specs/apimanagementapidiagnostic/api.yaml @@ -0,0 +1,838 @@ +--- !ruby/object:Api::Product +name: Azure ApiDiagnostic Management +versions: + - !ruby/object:Api::Product::Version + name: ga + base_url: NotUsedInAzure +scopes: + - NotUsedInAzure +objects: + - !ruby/object:Api::Resource + name: ApiDiagnostic + api_name: ApiManagement + base_url: NotUsedInAzure + + azure_sdk_definition: !ruby/object:Api::Azure::SDKDefinition + provider_name: Microsoft.ApiManagement + go_client_namespace: apimanagement + go_client: apiDiagnosticClient + python_client_namespace: azure.mgmt.apimanagement + python_client: ApiManagementClient.api_diagnostic + create: !ruby/object:Api::Azure::SDKOperationDefinition + go_func_name: CreateOrUpdate + python_func_name: create_or_update + request: + 'resourceGroupName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: resourceGroups + go_variable_name: resourceGroup + python_parameter_name: resource_group_name + python_variable_name: resource_group + 'serviceName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: service + go_variable_name: serviceName + python_parameter_name: service_name + python_variable_name: service_name + 'apiId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: apis + go_variable_name: apiID + python_parameter_name: api_id + python_variable_name: api_id + 'diagnosticId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: diagnostics + go_variable_name: diagnosticID + python_parameter_name: diagnostic_id + python_variable_name: diagnostic_id + '/': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + go_variable_name: parameters + go_type_name: DiagnosticContract + python_parameter_name: parameters + python_variable_name: parameters + '/properties': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Properties + go_type_name: DiagnosticContractProperties + '/alwaysLog': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [python] + python_field_name: always_log + '/properties/alwaysLog': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [go] + go_field_name: AlwaysLog + go_enum_type_name: AlwaysLog + '/loggerId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: logger_id + '/properties/loggerId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: LoggerID + '/sampling': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: sampling + '/sampling/samplingType': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [python] + python_field_name: sampling_type + '/sampling/percentage': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: percentage + '/properties/sampling': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Sampling + go_type_name: SamplingSettings + '/properties/sampling/samplingType': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [go] + go_field_name: SamplingType + go_enum_type_name: SamplingType + '/properties/sampling/percentage': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Percentage + '/frontend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: frontend + '/frontend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: request + '/frontend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/frontend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/frontend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/frontend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: response + '/frontend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/frontend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/frontend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/properties/frontend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Frontend + go_type_name: PipelineDiagnosticSettings + '/properties/frontend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Request + go_type_name: HttpMessageDiagnostic + '/properties/frontend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/frontend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/frontend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/properties/frontend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Response + go_type_name: HttpMessageDiagnostic + '/properties/frontend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/frontend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/frontend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/backend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: backend + '/backend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: request + '/backend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/backend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/backend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/backend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: response + '/backend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/backend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/backend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/properties/backend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Backend + go_type_name: PipelineDiagnosticSettings + '/properties/backend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Request + go_type_name: HttpMessageDiagnostic + '/properties/backend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/backend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/backend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/properties/backend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Response + go_type_name: HttpMessageDiagnostic + '/properties/backend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/backend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/backend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/enableHttpCorrelationHeaders': !ruby/object:Api::Azure::SDKTypeDefinition::BooleanObject + applicable_to: [python] + python_field_name: enable_http_correlation_headers + '/properties/enableHttpCorrelationHeaders': !ruby/object:Api::Azure::SDKTypeDefinition::BooleanObject + applicable_to: [go] + go_field_name: EnableHttpCorrelationHeaders + update: !ruby/object:Api::Azure::SDKOperationDefinition + go_func_name: Update + python_func_name: update + request: + 'resourceGroupName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: resourceGroups + go_variable_name: resourceGroup + python_parameter_name: resource_group_name + python_variable_name: resource_group + 'serviceName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: service + go_variable_name: serviceName + python_parameter_name: service_name + python_variable_name: service_name + 'apiId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: apis + go_variable_name: apiID + python_parameter_name: api_id + python_variable_name: api_id + 'diagnosticId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: diagnostics + go_variable_name: diagnosticID + python_parameter_name: diagnostic_id + python_variable_name: diagnostic_id + '/': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + go_variable_name: parameters + go_type_name: DiagnosticContract + python_parameter_name: parameters + python_variable_name: parameters + '/properties': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Properties + go_type_name: DiagnosticContractProperties + '/alwaysLog': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [python] + python_field_name: always_log + '/properties/alwaysLog': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [go] + go_field_name: AlwaysLog + go_enum_type_name: AlwaysLog + '/loggerId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: logger_id + '/properties/loggerId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: LoggerID + '/sampling': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: sampling + '/sampling/samplingType': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [python] + python_field_name: sampling_type + '/sampling/percentage': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: percentage + '/properties/sampling': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Sampling + go_type_name: SamplingSettings + '/properties/sampling/samplingType': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [go] + go_field_name: SamplingType + go_enum_type_name: SamplingType + '/properties/sampling/percentage': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Percentage + '/frontend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: frontend + '/frontend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: request + '/frontend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/frontend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/frontend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/frontend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: response + '/frontend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/frontend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/frontend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/properties/frontend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Frontend + go_type_name: PipelineDiagnosticSettings + '/properties/frontend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Request + go_type_name: HttpMessageDiagnostic + '/properties/frontend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/frontend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/frontend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/properties/frontend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Response + go_type_name: HttpMessageDiagnostic + '/properties/frontend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/frontend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/frontend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/backend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: backend + '/backend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: request + '/backend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/backend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/backend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/backend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: response + '/backend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/backend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/backend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/properties/backend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Backend + go_type_name: PipelineDiagnosticSettings + '/properties/backend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Request + go_type_name: HttpMessageDiagnostic + '/properties/backend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/backend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/backend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/properties/backend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Response + go_type_name: HttpMessageDiagnostic + '/properties/backend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/backend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/backend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/enableHttpCorrelationHeaders': !ruby/object:Api::Azure::SDKTypeDefinition::BooleanObject + applicable_to: [python] + python_field_name: enable_http_correlation_headers + '/properties/enableHttpCorrelationHeaders': !ruby/object:Api::Azure::SDKTypeDefinition::BooleanObject + applicable_to: [go] + go_field_name: EnableHttpCorrelationHeaders + delete: !ruby/object:Api::Azure::SDKOperationDefinition + go_func_name: Delete + python_func_name: delete + request: + 'resourceGroupName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: resourceGroups + go_variable_name: resourceGroup + python_parameter_name: resource_group_name + python_variable_name: resource_group + 'serviceName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: service + go_variable_name: serviceName + python_parameter_name: service_name + python_variable_name: service_name + 'apiId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: apis + go_variable_name: apiID + python_parameter_name: api_id + python_variable_name: api_id + 'diagnosticId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: diagnostics + go_variable_name: diagnosticID + python_parameter_name: diagnostic_id + python_variable_name: diagnostic_id + read: !ruby/object:Api::Azure::SDKOperationDefinition + go_func_name: Get + python_func_name: get + request: + 'resourceGroupName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: resourceGroups + go_variable_name: resourceGroup + python_parameter_name: resource_group_name + python_variable_name: resource_group + 'serviceName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: service + go_variable_name: serviceName + python_parameter_name: service_name + python_variable_name: service_name + 'apiId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: apis + go_variable_name: apiID + python_parameter_name: api_id + python_variable_name: api_id + 'diagnosticId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: diagnostics + go_variable_name: diagnosticID + python_parameter_name: diagnostic_id + python_variable_name: diagnostic_id + response: + '/properties': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Properties + go_type_name: DiagnosticContractProperties + '/properties/alwaysLog': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [go] + go_field_name: AlwaysLog + go_enum_type_name: AlwaysLog + '/alwaysLog': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [python] + python_field_name: always_log + '/properties/loggerId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: LoggerID + '/loggerId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: logger_id + '/properties/sampling': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Sampling + go_type_name: SamplingSettings + '/properties/sampling/samplingType': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [go] + go_field_name: SamplingType + go_enum_type_name: SamplingType + '/properties/sampling/percentage': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Percentage + '/sampling': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: sampling + '/sampling/samplingType': !ruby/object:Api::Azure::SDKTypeDefinition::EnumObject + applicable_to: [python] + python_field_name: sampling_type + '/sampling/percentage': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: percentage + '/properties/frontend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Frontend + go_type_name: PipelineDiagnosticSettings + '/properties/frontend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Request + go_type_name: HttpMessageDiagnostic + '/properties/frontend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/frontend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/frontend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/properties/frontend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Response + go_type_name: HttpMessageDiagnostic + '/properties/frontend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/frontend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/frontend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/frontend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: frontend + '/frontend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: request + '/frontend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/frontend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/frontend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/frontend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: response + '/frontend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/frontend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/frontend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/properties/backend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Backend + go_type_name: PipelineDiagnosticSettings + '/properties/backend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Request + go_type_name: HttpMessageDiagnostic + '/properties/backend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/backend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/backend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/properties/backend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Response + go_type_name: HttpMessageDiagnostic + '/properties/backend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [go] + go_field_name: Headers + '/properties/backend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [go] + go_field_name: Body + go_type_name: BodyDiagnosticSettings + '/properties/backend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [go] + go_field_name: Bytes + '/backend': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: backend + '/backend/request': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: request + '/backend/request/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/backend/request/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/backend/request/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/backend/response': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: response + '/backend/response/headers': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + applicable_to: [python] + python_field_name: headers + '/backend/response/body': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject + applicable_to: [python] + python_field_name: body + '/backend/response/body/bytes': !ruby/object:Api::Azure::SDKTypeDefinition::IntegerObject + applicable_to: [python] + python_field_name: bytes + '/properties/enableHttpCorrelationHeaders': !ruby/object:Api::Azure::SDKTypeDefinition::BooleanObject + applicable_to: [go] + go_field_name: EnableHttpCorrelationHeaders + '/enableHttpCorrelationHeaders': !ruby/object:Api::Azure::SDKTypeDefinition::BooleanObject + applicable_to: [python] + python_field_name: enable_http_correlation_headers + '/id': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + go_field_name: ID + python_field_name: id + '/name': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + go_field_name: Name + python_field_name: name + '/type': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + go_field_name: Type + python_field_name: type + list_by_parent: !ruby/object:Api::Azure::SDKOperationDefinition + go_func_name: ListByService + python_func_name: list_by_service + request: + 'resourceGroupName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: resourceGroups + go_variable_name: resourceGroup + python_parameter_name: resource_group_name + python_variable_name: resource_group + 'serviceName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: service + go_variable_name: serviceName + python_parameter_name: service_name + python_variable_name: service_name + 'apiId': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject + id_portion: apis + go_variable_name: apiID + python_parameter_name: api_id + python_variable_name: api_id + + description: | + Manage Azure ApiDiagnostic instance. + properties: + - !ruby/object:Api::Azure::Type::ResourceGroupName + name: 'resourceGroup' + description: 'The name of the resource group.' + required: true + input: true + sample_value: myResourceGroup + azure_sdk_references: ['resourceGroupName'] + - !ruby/object:Api::Type::String + name: 'serviceName' + description: 'The name of the API Management service.' + required: true + input: true + sample_value: 'myService' + azure_sdk_references: ['serviceName'] + - !ruby/object:Api::Type::String + name: 'apiId' + description: 'API identifier. Must be unique in the current API Management service instance.' + required: true + input: true + sample_value: 'myApi' + azure_sdk_references: ['apiId'] + - !ruby/object:Api::Type::String + name: 'diagnosticId' + description: 'Diagnostic identifier. Must be unique in the current API Management service instance.' + required: true + input: true + sample_value: 'myDiagnostic' + azure_sdk_references: ['diagnosticId'] + - !ruby/object:Api::Type::Enum + name: 'alwaysLog' + description: 'Specifies for what type of messages sampling settings should not apply.' + required: false + values: + - :allErrors + default_value: :allErrors + sample_value: allErrors + azure_sdk_references: ['/alwaysLog', '/properties/alwaysLog'] + - !ruby/object:Api::Type::String + name: 'loggerId' + description: 'Resource Id of a target logger.' + required: true + sample_value: '/loggers/applicationinsights' + azure_sdk_references: ['/loggerId', '/properties/loggerId'] + - !ruby/object:Api::Type::NestedObject + name: 'sampling' + description: 'Sampling settings for Diagnostic.' + required: false + azure_sdk_references: ['/sampling', '/properties/sampling'] + properties: + - !ruby/object:Api::Type::Enum + name: 'samplingType' + description: 'Sampling type.' + required: false + values: + - :fixed + default_value: :fixed + sample_value: fixed + azure_sdk_references: ['/sampling/samplingType', '/properties/sampling/samplingType'] + - !ruby/object:Api::Type::Integer + name: 'percentage' + description: 'Rate of sampling for fixed-rate sampling.' + required: false + sample_value: 50 + azure_sdk_references: ['/sampling/percentage', '/properties/sampling/percentage'] + - !ruby/object:Api::Type::NestedObject + name: 'frontend' + description: 'Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.' + required: false + azure_sdk_references: ['/frontend', '/properties/frontend'] + properties: + - !ruby/object:Api::Type::NestedObject + name: 'request' + description: 'Diagnostic settings for request.' + required: false + azure_sdk_references: ['/frontend/request', '/properties/frontend/request'] + properties: + - !ruby/object:Api::Type::String + name: 'headers' + description: 'Array of HTTP Headers to log.' + required: false + sample_value: 'Content-type' + azure_sdk_references: ['/frontend/request/headers', '/properties/frontend/request/headers'] + - !ruby/object:Api::Type::NestedObject + name: 'body' + description: 'Body logging settings.' + required: false + azure_sdk_references: ['/frontend/request/body', '/properties/frontend/request/body'] + properties: + - !ruby/object:Api::Type::Integer + name: 'bytes' + description: 'Number of request body bytes to log.' + required: false + sample_value: 512 + azure_sdk_references: ['/frontend/request/body/bytes', '/properties/frontend/request/body/bytes'] + - !ruby/object:Api::Type::NestedObject + name: 'response' + description: 'Diagnostic settings for response.' + required: false + azure_sdk_references: ['/frontend/response', '/properties/frontend/response'] + properties: + - !ruby/object:Api::Type::String + name: 'headers' + description: 'Array of HTTP Headers to log.' + required: false + sample_value: 'Content-type' + azure_sdk_references: ['/frontend/response/headers', '/properties/frontend/response/headers'] + - !ruby/object:Api::Type::NestedObject + name: 'body' + description: 'Body logging settings.' + required: false + azure_sdk_references: ['/frontend/response/body', '/properties/frontend/response/body'] + properties: + - !ruby/object:Api::Type::Integer + name: 'bytes' + description: 'Number of request body bytes to log.' + required: false + sample_value: 512 + azure_sdk_references: ['/frontend/response/body/bytes', '/properties/frontend/response/body/bytes'] + - !ruby/object:Api::Type::NestedObject + name: 'backend' + description: 'Diagnostic settings for incoming/outgoing HTTP messages to the Backend' + required: false + azure_sdk_references: ['/backend', '/properties/backend'] + properties: + - !ruby/object:Api::Type::NestedObject + name: 'request' + description: 'Diagnostic settings for request.' + required: false + azure_sdk_references: ['/backend/request', '/properties/backend/request'] + properties: + - !ruby/object:Api::Type::String + name: 'headers' + description: 'Array of HTTP Headers to log.' + required: false + sample_value: 'Content-type' + azure_sdk_references: ['/backend/request/headers', '/properties/backend/request/headers'] + - !ruby/object:Api::Type::NestedObject + name: 'body' + description: 'Body logging settings.' + required: false + azure_sdk_references: ['/backend/request/body', '/properties/backend/request/body'] + properties: + - !ruby/object:Api::Type::Integer + name: 'bytes' + description: 'Number of request body bytes to log.' + required: false + sample_value: 512 + azure_sdk_references: ['/backend/request/body/bytes', '/properties/backend/request/body/bytes'] + - !ruby/object:Api::Type::NestedObject + name: 'response' + description: 'Diagnostic settings for response.' + required: false + azure_sdk_references: ['/backend/response', '/properties/backend/response'] + properties: + - !ruby/object:Api::Type::String + name: 'headers' + description: 'Array of HTTP Headers to log.' + required: false + sample_value: 'Content-type' + azure_sdk_references: ['/backend/response/headers', '/properties/backend/response/headers'] + - !ruby/object:Api::Type::NestedObject + name: 'body' + description: 'Body logging settings.' + required: false + azure_sdk_references: ['/backend/response/body', '/properties/backend/response/body'] + properties: + - !ruby/object:Api::Type::Integer + name: 'bytes' + description: 'Number of request body bytes to log.' + required: false + sample_value: 512 + azure_sdk_references: ['/backend/response/body/bytes', '/properties/backend/response/body/bytes'] + - !ruby/object:Api::Type::Boolean + name: 'enableHttpCorrelationHeaders' + description: 'Whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true.' + required: false + azure_sdk_references: ['/enableHttpCorrelationHeaders', '/properties/enableHttpCorrelationHeaders'] + # read only values included only in response + - !ruby/object:Api::Type::String + name: 'id' + description: 'Resource ID.' + input: true + output: true + azure_sdk_references: ['/id'] + - !ruby/object:Api::Type::String + name: 'name' + description: 'Resource name.' + input: true + output: true + azure_sdk_references: ['/name'] + - !ruby/object:Api::Type::String + name: 'type' + description: 'Resource type for API Management resource.' + input: true + output: true + azure_sdk_references: ['/type'] \ No newline at end of file diff --git a/specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_delete.yml b/specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_delete.yml new file mode 100644 index 0000000..6352c52 --- /dev/null +++ b/specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_delete.yml @@ -0,0 +1,11 @@ +--- !ruby/object:Provider::Ansible::Example +task: !ruby/object:Provider::Ansible::Task + name: azure_rm_apimanagementapidiagnostic + description: ApiManagementDeleteApiDiagnostic + code: + resource_group: myResourceGroup + service_name: myService + api_id: myApi + diagnostic_id: myDiagnostic + state: absent + \ No newline at end of file diff --git a/specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_patch.yml b/specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_patch.yml new file mode 100644 index 0000000..bd2a7e3 --- /dev/null +++ b/specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_patch.yml @@ -0,0 +1,37 @@ +--- !ruby/object:Provider::Ansible::Example +task: !ruby/object:Provider::Ansible::Task + name: azure_rm_apimanagementapidiagnostic + description: ApiManagementUpdateApiDiagnostic + code: + resource_group: myResourceGroup + service_name: myService + api_id: myApi + diagnostic_id: myDiagnostic + always_log: allErrors + logger_id: /loggers/applicationinsights + sampling: + sampling_type: fixed + percentage: '50' + frontend: + request: + headers: + - Content-type + body: + bytes: '512' + response: + headers: + - Content-type + body: + bytes: '512' + backend: + request: + headers: + - Content-type + body: + bytes: '512' + response: + headers: + - Content-type + body: + bytes: '512' + \ No newline at end of file diff --git a/specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_put.yml b/specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_put.yml new file mode 100644 index 0000000..cff53f4 --- /dev/null +++ b/specs/apimanagementapidiagnostic/examples/ansible/apimanagement_service_apis_diagnostics_put.yml @@ -0,0 +1,37 @@ +--- !ruby/object:Provider::Ansible::Example +task: !ruby/object:Provider::Ansible::Task + name: azure_rm_apimanagementapidiagnostic + description: ApiManagementCreateApiDiagnostic + code: + resource_group: myResourceGroup + service_name: myService + api_id: myApi + diagnostic_id: myDiagnostic + always_log: allErrors + logger_id: /loggers/applicationinsights + sampling: + sampling_type: fixed + percentage: '50' + frontend: + request: + headers: + - Content-type + body: + bytes: '512' + response: + headers: + - Content-type + body: + bytes: '512' + backend: + request: + headers: + - Content-type + body: + bytes: '512' + response: + headers: + - Content-type + body: + bytes: '512' + \ No newline at end of file diff --git a/specs/apimanagementapidiagnostic/terraform.yaml b/specs/apimanagementapidiagnostic/terraform.yaml new file mode 100644 index 0000000..0ee4e86 --- /dev/null +++ b/specs/apimanagementapidiagnostic/terraform.yaml @@ -0,0 +1,4 @@ +--- !ruby/object:Provider::Azure::Terraform::Config +overrides: !ruby/object:Overrides::ResourceOverrides + ApiDiagnostic: !ruby/object:Provider::Azure::Terraform::ResourceOverride + properties: {}