set azure metadata

This commit is contained in:
Matthew Hooker 2017-06-01 14:11:40 -07:00
parent e01cd49175
commit 5ed3be9a8c
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 18 additions and 2 deletions

View File

@ -90,8 +90,13 @@ func (*Artifact) Id() string {
return ""
}
func (*Artifact) State(name string) interface{} {
return nil
func (a *Artifact) State(name string) interface{} {
switch name {
case "atlas.artifact.metadata":
return a.stateAtlasMetadata()
default:
return nil
}
}
func (a *Artifact) String() string {
@ -110,3 +115,14 @@ func (a *Artifact) String() string {
func (*Artifact) Destroy() error {
return nil
}
func (a *Artifact) stateAtlasMetadata() interface{} {
metadata := make(map[string]string)
metadata["StorageAccountLocation"] = a.StorageAccountLocation
metadata["OSDiskUri"] = a.OSDiskUri
metadata["OSDiskUriReadOnlySas"] = a.OSDiskUriReadOnlySas
metadata["TemplateUri"] = a.TemplateUri
metadata["TemplateUriReadOnlySas"] = a.TemplateUriReadOnlySas
return metadata
}