AddLogValuesForResourceID adds common logging key/value pairs from a resource ID. It adds: subscription_id, resource_group, resource_name, resource_id, and hcp_cluster_name (if applicable).
(resourceID *azcorearm.ResourceID)
| 231 | return ret |
| 232 | } |
| 233 | |
| 234 | // AddSubscriptionID adds the "subscription_id" key with the lowercased value. |
| 235 | func (lv LogValues) AddSubscriptionID(value string) LogValues { |
| 236 | return append(lv, "subscription_id", strings.ToLower(value)) |
| 237 | } |
| 238 | |
| 239 | // AddLogValuesForResourceID adds common logging key/value pairs from a resource ID. |
| 240 | // It adds: subscription_id, resource_group, resource_name, resource_id, and hcp_cluster_name (if applicable). |
| 241 | func (lv LogValues) AddLogValuesForResourceID(resourceID *azcorearm.ResourceID) LogValues { |
| 242 | if resourceID == nil { |
| 243 | return lv |
| 244 | } |
| 245 | lv = lv.AddSubscriptionID(resourceID.SubscriptionID). |
| 246 | AddResourceGroup(resourceID.ResourceGroupName). |
| 247 | AddResourceType(resourceID.ResourceType.String()). |
| 248 | AddResourceName(resourceID.Name). |
| 249 | AddResourceID(resourceID.String()) |
| 250 |
no test coverage detected