Skip to content

Commit

Permalink
Updated the azurerm_scheduler_job_collection data source with request…
Browse files Browse the repository at this point in the history
…ed changes
  • Loading branch information
katbyte committed Mar 19, 2018
1 parent 0c83795 commit 5977c3e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
20 changes: 19 additions & 1 deletion azurerm/data_source_scheduler_job_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,23 @@ func dataSourceArmSchedulerJobCollectionRead(d *schema.ResourceData, meta interf

d.SetId(*collection.ID)

return resourceArmSchedulerJobCollectionPopulate(d, resourceGroup, &collection)
//standard properties
d.Set("name", collection.Name)
d.Set("location", azureRMNormalizeLocation(*collection.Location))
d.Set("resource_group_name", resourceGroup)
flattenAndSetTags(d, collection.Tags)

//resource specific
if properties := collection.Properties; properties != nil {
if sku := properties.Sku; sku != nil {
d.Set("sku", sku.Name)
}
d.Set("state", string(properties.State))

if err := d.Set("quota", flattenAzureArmSchedulerJobCollectionQuota(properties.Quota)); err != nil {
return fmt.Errorf("Error flattening quota for Job Collection %q (Resource Group %q): %+v", collection.Name, resourceGroup, err)
}
}

return nil
}
12 changes: 6 additions & 6 deletions website/docs/d/scheduler_job_collection.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ output "job_collection_state" {

The following arguments are supported:

* `name` - (Required) Specifies the name of the Scheduler Job Collection. Changing this forces a new resource to be created.
* `name` - (Required) Specifies the name of the Scheduler Job Collection.

* `resource_group_name` - (Required) The name of the resource group in which to create the Scheduler Job Collection. Changing this forces a new resource to be created.
* `resource_group_name` - (Required) Specifies the name of the resource group in which the Scheduler Job Collection resides.

## Attributes Reference

Expand All @@ -39,18 +39,18 @@ The following attributes are exported:

* `location` - The Azure location where the resource exists.

* `tags` - A mapping of tags to assign to the resource.
* `tags` - A mapping of tags assigned to the resource.

* `sku` - The Job Collection's pricing level's SKU. Possible values include: `Standard`, `Free`, `P10Premium`, `P20Premium`.
* `sku` - The Job Collection's pricing level's SKU.

* `state` - The Job Collection's state. Possible values include: `Enabled`, `Disabled`, `Suspended`.
* `state` - The Job Collection's state.

* `quota` - The Job collection quotas as documented in the `quota` block below.

The `quota` block supports:

* `max_job_count` - Sets the maximum number of jobs in the collection.

* `max_recurrence_frequency` - The maximum frequency of recurrence. Possible values include: `Minute`, `Hour`, `Day`, `Week`, `Month`
* `max_recurrence_frequency` - The maximum frequency of recurrence.

* `max_retry_interval` - The maximum interval between retries.

0 comments on commit 5977c3e

Please sign in to comment.