UpdateResourceGroupByMap
This method updates a resource group details on the effective date defined within the change set.
UpdateResourceGroupByMap (ResourceGroupName,ResourceGroupDetails)
|
Name |
Type |
Description |
|
ResourceGroupName |
string |
The name of the resource group. |
|
ResourceGroupDetails |
Map |
Map of resource group details is in the structure of the map returned from GetResourceGroupDetails method. The ResourceGroups, Resources, and Services internal maps can be empty. The ResourceGroupId entry is not relevant. The ResourceTypes entry must contain at least one resource type. The CustomAttributes internal map must contain all of the custom attributes that are attached to the resource groups. |
We recommend calling "Tools.UpdateResourceGroupByMap" (or "Tools.UpdateResourceByMap") instead of multiple calls to "Tools.UpdateResourcesCustomAttribute".
Option Explicit
Const CHANGESET_NAME = "Default"
'This script assumes that the following resource Group exists
Const RESOURCE_TEMPLATE_NAME = "ResourceGroupTemplate"
Sub OnLoad()
'Tools.log "Integration Script : In OnLoad procedure", "I"
End Sub
Sub Main()
Dim resourceGroupName
resourceGroupName = "MyResourceGroup1"
Dim aMap
Set aMap = Tools.GetResourceGroupDetails (RESOURCE_TEMPLATE_NAME, CHANGESET_NAME)
aMap("ResourceName") = resourceGroupName
'aMap("ChangeSetName") = CHANGESET_NAME
aMap("CustomAttributes")("Owner")("CustomAttributeValue") = "Joe"
aMap("CustomAttributes")("SerialNumber")("CustomAttributeValue") = "123456"
If Not Tools.IsResourceExists(resourceName) Then
Tools.AddResourceGroupByMap(aMap)
Else
Tools.UpdateResourceGroupByMap resourceGroupName, aMap
End If
'Tools.CommitResources resourceGroupName
Tools.Commit
End Sub
Function Result
'Tools.log " Integration Script : In Result function", "I"
'Result =
End Function
| Copyright © 2012 CA. Tous droits réservés. | Envoyer un courriel à CA Technologies sur cette rubrique |