Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azure - update resource examples in docs #4081

Merged
merged 4 commits into from May 29, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/azure/examples/addstoragefirewall.rst
@@ -1,3 +1,5 @@
.. _azure_examples_add_firewall_rules_to_storage:

Add storage firewall
====================

Expand Down
2 changes: 2 additions & 0 deletions docs/source/azure/examples/resizeappplan.rst
@@ -1,3 +1,5 @@
.. _azure_examples_resize_app_service_plan:

Resize an Application Service Plan
==============================================================
Count or Size can be provided individually or together.
Expand Down
27 changes: 1 addition & 26 deletions docs/source/azure/policy/resources/appserviceplan.rst
Expand Up @@ -33,29 +33,4 @@ Actions

Example Policies
----------------

This set of policies will mark all app services for deletion in 7 days that have 'test' in name (ignore case),
and then perform the delete operation on those ready for deletion.

.. code-block:: yaml

policies:
- name: mark-test-appservice-for-deletion
resource: azure.appserviceplan
filters:
- type: value
key: name
op: in
value_type: normalize
value: test
actions:
- type: mark-for-op
op: delete
days: 7
- name: delete-test-appservice
resource: azure.appserviceplan
filters:
- type: marked-for-op
op: delete
actions:
- type: delete
- :ref:`azure_examples_resize_app_service_plan`
33 changes: 2 additions & 31 deletions docs/source/azure/policy/resources/arm.rst
@@ -1,7 +1,7 @@
.. _azure_armresource:

Network Interface
=================
Azure ARM Resource
==================

Filters
-------
Expand All @@ -15,32 +15,3 @@ Actions
-------
- ARM Resource Actions (see :ref:`azure_genericarmaction`)

Example Policies
----------------

This set of policies will mark all ARM resources for deletion in 7 days that have 'test' in name (ignore case),
and then perform the delete operation on those ready for deletion.


.. code-block:: yaml

policies:
- name: mark-test-armresources-for-deletion
resource: azure.armresource
filters:
- type: value
key: name
op: in
value_type: normalize
value: test
actions:
- type: mark-for-op
op: delete
days: 7
- name: delete-test-armresources
resource: azure.armresource
filters:
- type: marked-for-op
op: delete
actions:
- type: delete
28 changes: 8 additions & 20 deletions docs/source/azure/policy/resources/batch.rst
Expand Up @@ -18,28 +18,16 @@ Actions
Example Policies
----------------

This set of policies will mark all Batch Accounts for deletion in 7 days that have 'test' in name (ignore case),
and then perform the delete operation on those ready for deletion.
This set of policies will find all Azure Batch services that have more than 100 cores as the limit for the dedicated core quota.

.. code-block:: yaml

policies:
- name: mark-test-batch-for-deletion
- name: find-batch-with-high-dedicated-cores
resource: azure.batch
filters:
- type: value
key: name
op: in
value_type: normalize
value: test
actions:
- type: mark-for-op
op: delete
days: 7
- name: delete-test-batch
resource: azure.batch
filters:
- type: marked-for-op
op: delete
actions:
- type: delete
resource: azure.batch
filters:
- type: value
key: properties.dedicatedCoreQuota
op: gt
value: 100
40 changes: 2 additions & 38 deletions docs/source/azure/policy/resources/cognitiveservices.rst
Expand Up @@ -19,38 +19,12 @@ Actions
Example Policies
----------------

This set of policies will mark all Cognitive Services accounts for deletion in 7 days that have 'test' in name (ignore case),
and then perform the delete operation on those ready for deletion.
This policy will find all Cognitive Service accounts with 1000 or more total errors over the 72 hours

.. code-block:: yaml

policies:
- name: mark-test-cogserv-for-deletion
resource: azure.cognitiveservice
filters:
- type: value
key: name
op: in
value_type: normalize
value: test
actions:
- type: mark-for-op
op: delete
days: 7
- name: delete-test-cogserv
resource: azure.cognitiveservice
filters:
- type: marked-for-op
op: delete
actions:
- type: delete

This policy will find all Cognitive Service accounts with 1000 or more total errors over the 72 hours and notify user@domain.com

.. code-block:: yaml

policies:
- name: notify-cogserv-many-failures
- name: cogserv-many-failures
resource: azure.cognitiveservice
filters:
- type: metric
Expand All @@ -59,13 +33,3 @@ This policy will find all Cognitive Service accounts with 1000 or more total err
aggregation: total
threshold: 1000
timeframe: 72
actions:
- type: notify
template: default
priority_header: 2
subject: Cognitive Services with Errors
to:
- user@domain.com
transport:
- type: asq
queue: https://accountname.queue.core.windows.net/queuename
40 changes: 2 additions & 38 deletions docs/source/azure/policy/resources/cosmosdb.rst
Expand Up @@ -19,38 +19,12 @@ Actions
Example Policies
----------------

This set of policies will mark all CosmosDB for deletion in 7 days that have 'test' in name (ignore case),
and then perform the delete operation on those ready for deletion.
This policy will find all CosmosDB with 1000 or less total requests over the last 72 hours

.. code-block:: yaml

policies:
- name: mark-test-cosmosdb-for-deletion
resource: azure.cosmosdb
filters:
- type: value
key: name
op: in
value_type: normalize
value: test
actions:
- type: mark-for-op
op: delete
days: 7
- name: delete-marked-cosmosdbs
resource: azure.cosmosdb
filters:
- type: marked-for-op
op: delete
actions:
- type: delete

This policy will find all CosmosDB with 1000 or less total requests over the last 72 hours and notify user@domain.com

.. code-block:: yaml

policies:
- name: notify-cosmosdb-inactive
- name: cosmosdb-inactive
resource: azure.cosmosdb
filters:
- type: metric
Expand All @@ -59,13 +33,3 @@ This policy will find all CosmosDB with 1000 or less total requests over the las
aggregation: total
threshold: 1000
timeframe: 72
actions:
- type: notify
template: default
priority_header: 2
subject: Inactive CosmosDB
to:
- user@domain.com
transport:
- type: asq
queue: https://accountname.queue.core.windows.net/queuename
40 changes: 2 additions & 38 deletions docs/source/azure/policy/resources/datafactory.rst
Expand Up @@ -19,38 +19,12 @@ Actions
Example Policies
----------------

This set of policies will mark all Data Factories for deletion in 7 days that have 'test' in name (ignore case),
and then perform the delete operation on those ready for deletion.
This policy will find all Data Factories with 10 or more failures in pipeline runs over the last 72 hours

.. code-block:: yaml

policies:
- name: mark-test-datafactories-for-deletion
resource: azure.datafactory
filters:
- type: value
key: name
op: in
value_type: normalize
value: test
actions:
- type: mark-for-op
op: delete
days: 7
- name: delete-test-datafactories
resource: azure.datafactory
filters:
- type: marked-for-op
op: delete
actions:
- type: delete

This policy will find all Data Factories with 10 or more failures in pipeline runs over the last 72 hours and notify user@domain.com

.. code-block:: yaml

policies:
- name: notify-datafactory-dropping-messages
- name: datafactory-dropping-messages
resource: azure.datafactory
filters:
- type: metric
Expand All @@ -59,13 +33,3 @@ This policy will find all Data Factories with 10 or more failures in pipeline ru
aggregation: total
threshold: 10
timeframe: 72
actions:
- type: notify
template: default
priority_header: 2
subject: Datafactory Pipeline Failing
to:
- user@domain.com
transport:
- type: asq
queue: https://accountname.queue.core.windows.net/queuename
12 changes: 1 addition & 11 deletions docs/source/azure/policy/resources/datalake.rst
Expand Up @@ -24,7 +24,7 @@ This policy will find all Datalake Stores with one million or more write request
.. code-block:: yaml

policies:
- name: notify-datalake-busy
- name: datalake-busy
resource: azure.datalake
filters:
- type: metric
Expand All @@ -33,13 +33,3 @@ This policy will find all Datalake Stores with one million or more write request
aggregation: total
threshold: 1000000
timeframe: 72
actions:
- type: notify
template: default
priority_header: 2
subject: Busy Datalake Stores
to:
- user@domain.com
transport:
- type: asq
queue: https://accountname.queue.core.windows.net/queuename
26 changes: 0 additions & 26 deletions docs/source/azure/policy/resources/disk.rst
Expand Up @@ -31,29 +31,3 @@ Deletes all disks that are currently not being managed by a VM
value: null
actions:
- type: delete

This set of policies will mark all disks for deletion in 7 days that have 'test' in name (ignore case),
and then perform the delete operation on those ready for deletion.

.. code-block:: yaml

policies:
- name: mark-test-disk-for-deletion
resource: azure.disk
filters:
- type: value
key: name
op: in
value_type: normalize
value: test
actions:
- type: mark-for-op
op: delete
days: 7
- name: delete-test-disk
resource: azure.disk
filters:
- type: marked-for-op
op: delete
actions:
- type: delete
40 changes: 2 additions & 38 deletions docs/source/azure/policy/resources/iothub.rst
Expand Up @@ -19,38 +19,12 @@ Actions
Example Policies
----------------

This set of policies will mark all IoT Hubs for deletion in 7 days that have 'test' in name (ignore case),
and then perform the delete operation on those ready for deletion.
This policy will find all IoT Hubs with 1000 or more dropped messages over the last 72 hours

.. code-block:: yaml

policies:
- name: mark-test-iothubs-for-deletion
resource: azure.iothub
filters:
- type: value
key: name
op: in
value_type: normalize
value: test
actions:
- type: mark-for-op
op: delete
days: 7
- name: delete-test-iothubs
resource: azure.iothub
filters:
- type: marked-for-op
op: delete
actions:
- type: delete

This policy will find all IoT Hubs with 1000 or more dropped messages over the last 72 hours and notify user@domain.com

.. code-block:: yaml

policies:
- name: notify-iothubs-dropping-messages
- name: iothubs-dropping-messages
resource: azure.iothub
filters:
- type: metric
Expand All @@ -59,13 +33,3 @@ This policy will find all IoT Hubs with 1000 or more dropped messages over the l
aggregation: total
threshold: 1000
timeframe: 72
actions:
- type: notify
template: default
priority_header: 2
subject: IOT Hubs Dropping Messages
to:
- user@domain.com
transport:
- type: asq
queue: https://accountname.queue.core.windows.net/queuename