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 14 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
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ steps:
failOnStderr: true

- bash: |
export source_branch=$(System.PullRequest.SourceBranch)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend pass the source_branch as argument to Makefile instead of using environment variable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Now the source_branch is passed as argument.

make build && \
make format-terraform
displayName: 'code generation'
Expand Down
2 changes: 1 addition & 1 deletion list_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cd `dirname $0`
for file in `ls ./specs`; do
work_dir=./specs/$file
if [ -d $work_dir ]; then
if [ -n "$(git status -s $work_dir)" ];
if [ -n "$(git diff --name-only remotes/origin/master remotes/origin/$source_branch -- $work_dir)" ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we need to run it in local environment ? Can we add a fallback logic ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the fallback logic in script.

  • We can run make build SOURCE_BRANCH=branchname, to generate codes for new added/modified resources in local branch
  • If SOURCE_BRANCH is not set, it uses current branch as default, and generates codes for new added/modified resources in current branch
  • For uncommitted changes, just uses make build RESOURCE=resourcename as before

then
# remove the directory prefix './specs/'
expr substr "$work_dir" 9 "${#work_dir}"
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: {}