-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into support-azure-hpc-cache
- Loading branch information
Showing
15 changed files
with
463 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.114.3 | ||
1.116.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
docs-chef-io/content/inspec/resources/azure_hpc_asc_operation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
+++ | ||
title = "azure_hpc_asc_operation Resource" | ||
platform = "azure" | ||
draft = false | ||
gh_repo = "inspec-azure" | ||
|
||
[menu.inspec] | ||
title = "azure_hpc_asc_operation" | ||
identifier = "inspec/resources/azure/azure_hpc_asc_operation Resource" | ||
parent = "inspec/resources/azure" | ||
+++ | ||
|
||
Use the `azure_hpc_asc_operation` InSpec audit resource to test the properties related to an Azure HPC ASC Operation. | ||
|
||
## Azure REST API Version, Endpoint, and HTTP Client Parameters | ||
|
||
{{% inspec_azure_common_parameters %}} | ||
|
||
## Installation | ||
|
||
{{% inspec_azure_install %}} | ||
|
||
## Syntax | ||
|
||
`name`, `cache_name`, and `resource_group` are required parameters. | ||
|
||
```ruby | ||
describe azure_hpc_asc_operation(location: 'LOCATION', operation_id: 'OPERATION_ID') do | ||
it { should exist } | ||
its('type') { should eq 'Microsoft.StorageCache/Cache/StorageTarget' } | ||
its('location') { should eq 'East US' } | ||
end | ||
``` | ||
|
||
```ruby | ||
describe azure_hpc_asc_operation(location: 'LOCATION', operation_id: 'OPERATION_ID') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Parameters | ||
|
||
`location` _(required)_ | ||
: The name of the region used to look up the operation. | ||
|
||
`operation_id` _(required)_ | ||
: The operation ID that uniquely identifies the asynchronous operation. | ||
|
||
## Properties | ||
|
||
`id` | ||
: The operation Id. | ||
|
||
`name` | ||
: The operation name. | ||
|
||
`startTime` | ||
: The start time of the operation. | ||
|
||
`status` | ||
: The status of the operation. | ||
|
||
`endTime` | ||
: The end time of the operation. | ||
|
||
For properties applicable to all resources, such as `type`, `name`, `id`, `properties`, refer to [`azure_generic_resource`]({{< relref "azure_generic_resource.md#properties" >}}). | ||
|
||
Also, refer to [Azure documentation](https://docs.microsoft.com/en-us/rest/api/storagecache/asc-operations/get#ascoperation) for other properties available. | ||
|
||
## Examples | ||
|
||
**Test that the HPC ASC Operation is Succeeded.** | ||
|
||
```ruby | ||
describe azure_hpc_asc_operation(location: 'LOCATION', operation_id: 'OPERATION_ID') do | ||
its('status') { should eq 'Succeeded' } | ||
end | ||
``` | ||
|
||
## Matchers | ||
|
||
{{% inspec_matchers_link %}} | ||
|
||
### exists | ||
|
||
```ruby | ||
# If a HPC ASC Operation is found it will exist | ||
describe azure_hpc_asc_operation(location: 'LOCATION', operation_id: 'OPERATION_ID') do | ||
it { should exist } | ||
end | ||
# if HPC ASC Operation is not found it will not exist | ||
describe azure_hpc_asc_operation(location: 'LOCATION', operation_id: 'OPERATION_ID') do | ||
it { should_not exist } | ||
end | ||
``` | ||
|
||
## Azure Permissions | ||
|
||
{{% azure_permissions_service_principal role="reader" %}} |
85 changes: 85 additions & 0 deletions
85
docs-chef-io/content/inspec/resources/azure_hpc_cache_skus.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
+++ | ||
title = "azure_hpc_cache_skus Resource" | ||
platform = "azure" | ||
draft = false | ||
gh_repo = "inspec-azure" | ||
|
||
[menu.inspec] | ||
title = "azure_hpc_cache_skus" | ||
identifier = "inspec/resources/azure/azure_hpc_cache_skus Resource" | ||
parent = "inspec/resources/azure" | ||
+++ | ||
|
||
Use the `azure_hpc_cache_skus` InSpec audit resource to test the properties related to all Azure HPC Cache SKUs. | ||
|
||
## Azure REST API Version, Endpoint, and HTTP Client Parameters | ||
|
||
{{% inspec_azure_common_parameters %}} | ||
|
||
## Installation | ||
|
||
{{% inspec_azure_install %}} | ||
|
||
## Syntax | ||
|
||
An `azure_hpc_cache_skus` resource block returns all Azure HPC Cache SKUs. | ||
|
||
```ruby | ||
describe azure_hpc_cache_skus do | ||
#... | ||
end | ||
``` | ||
|
||
## Parameters | ||
|
||
## Properties | ||
|
||
`resourceTypes` | ||
: A resource types list of the SKU applies to. **Field**: `resourceType` | ||
|
||
`names` | ||
: A list of SKU names. **Field**: `name` | ||
|
||
`sizes` | ||
: A list of the SKU sizes. **Field**: `size` | ||
|
||
`tiers` | ||
: A tiers list of VM in a scale set. **Field**: `tier` | ||
|
||
`kind` | ||
: The supported kind list of resources. **Field**: `kind` | ||
|
||
{{% inspec_filter_table %}} | ||
|
||
## Examples | ||
|
||
### Ensure that there are Standard tier HPC Cache SKUs | ||
|
||
```ruby | ||
describe azure_hpc_cache_skus.where(tier: 'STANDARD') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Matchers | ||
|
||
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our [Universal Matchers page](https://www.inspec.io/docs/reference/matchers/). | ||
|
||
### exists | ||
|
||
```ruby | ||
# Should not exist if no HPC Cache SKUs are present | ||
|
||
describe azure_hpc_cache_skus do | ||
it { should_not exist } | ||
end | ||
# Should exist if the filter returns at least one HPC Cache SKUs | ||
|
||
describe azure_hpc_cache_skus do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Azure Permissions | ||
|
||
{{% azure_permissions_service_principal role="reader" %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'azure_generic_resource' | ||
|
||
class AzureHPCASCOperation < AzureGenericResource | ||
name 'azure_hpc_asc_operation' | ||
desc 'Retrieves and verifies the settings of an Azure HPC ASC Operation' | ||
example <<-EXAMPLE | ||
describe azure_hpc_asc_operation(location: 'westus', operation_id: 'testoperationid') do | ||
it { should exist } | ||
end | ||
EXAMPLE | ||
|
||
def initialize(opts = {}) | ||
raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) | ||
|
||
opts[:resource_provider] = specific_resource_constraint('Microsoft.StorageCache/locations', opts) | ||
opts[:required_parameters] = %i(location operation_id) | ||
opts[:resource_path] = [opts[:location], 'ascOperations', opts[:operation_id]].join('/') | ||
super(opts, true) | ||
end | ||
|
||
def to_s | ||
super(AzureHPCASCOperations) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'azure_generic_resources' | ||
|
||
class AzureHPCCacheSKUs < AzureGenericResources | ||
name 'azure_hpc_cache_skus' | ||
desc 'Verifies settings for a collection of Azure HPC Storage SKUs' | ||
example <<-EXAMPLE | ||
describe azure_hpc_cache_skus do | ||
it { should exist } | ||
end | ||
EXAMPLE | ||
|
||
def initialize(opts = {}) | ||
raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) | ||
|
||
opts[:resource_provider] = specific_resource_constraint('Microsoft.StorageCache/skus', opts) | ||
super(opts, true) | ||
return if failed_resource? | ||
|
||
populate_filter_table_from_response | ||
end | ||
|
||
def to_s | ||
super(AzureHPCCacheSKUs) | ||
end | ||
end |
Oops, something went wrong.