Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

autogenerated-apimanagementapidiagnostic #87

Merged
merged 18 commits into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) && \
Expand All @@ -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) && \
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 19 additions & 4 deletions list_resources.sh
Original file line number Diff line number Diff line change
@@ -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 -a | grep -w $source_branch)" ] || [ -z "$(git branch -a | grep -w $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
Expand Down
3 changes: 0 additions & 3 deletions resources.json

This file was deleted.

6 changes: 6 additions & 0 deletions specs/apimanagementapidiagnostic/ansible.yaml
Original file line number Diff line number Diff line change
@@ -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: []
838 changes: 838 additions & 0 deletions specs/apimanagementapidiagnostic/api.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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'

Original file line number Diff line number Diff line change
@@ -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'

4 changes: 4 additions & 0 deletions specs/apimanagementapidiagnostic/terraform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--- !ruby/object:Provider::Azure::Terraform::Config
overrides: !ruby/object:Overrides::ResourceOverrides
ApiDiagnostic: !ruby/object:Provider::Azure::Terraform::ResourceOverride
properties: {}