Skip to content

Commit

Permalink
Service datasource (#103)
Browse files Browse the repository at this point in the history
removed additional properties
  • Loading branch information
AnikaAgiwal2711 authored Feb 27, 2024
1 parent daf5f9e commit 83a8183
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 33 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ require (
golang.org/x/sys v0.2.0 // indirect
)

go 1.22
go 1.22
4 changes: 2 additions & 2 deletions service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestGetDeployeServiceByID(t *testing.T) {
t.Fatal(err)
}

_, err = GC.GetServiceDetailsByID(tc.id,false)
_, err = GC.GetServiceDetailsByID(tc.id, false)
if err != nil {
if tc.expected == nil {
t.Errorf("Getting template by ID did not work as expected, \n\tgot: %s \n\twant: %v", err, tc.expected)
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestGetDeployeServiceByIDNegative(t *testing.T) {
t.Fatal(err)
}

templates, err := client.GetServiceDetailsByID("Test",false)
templates, err := client.GetServiceDetailsByID("Test", false)
assert.Nil(t, templates)
assert.NotNil(t, err)
}
Expand Down
39 changes: 9 additions & 30 deletions types/v1/templateTypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,6 @@ type ComponentValid struct {
Messages []Messages `json:"messages,omitempty"`
}

type RelatedComponents struct {
AdditionalProp1 string `json:"additionalProp1,omitempty"`
AdditionalProp2 string `json:"additionalProp2,omitempty"`
AdditionalProp3 string `json:"additionalProp3,omitempty"`
}

type DependenciesDetails struct {
ID string `json:"id,omitempty"`
DependencyTarget string `json:"dependencyTarget,omitempty"`
Expand Down Expand Up @@ -436,35 +430,24 @@ type ExternalVirtualDisks struct {
EncryptionType string `json:"encryptionType,omitempty"`
}

type SizeToDiskMap struct {
AdditionalProp1 int `json:"additionalProp1,omitempty"`
AdditionalProp2 int `json:"additionalProp2,omitempty"`
AdditionalProp3 int `json:"additionalProp3,omitempty"`
}

type RaidConfiguration struct {
VirtualDisks []VirtualDisks `json:"virtualDisks,omitempty"`
ExternalVirtualDisks []ExternalVirtualDisks `json:"externalVirtualDisks,omitempty"`
HddHotSpares []string `json:"hddHotSpares,omitempty"`
SsdHotSpares []string `json:"ssdHotSpares,omitempty"`
ExternalHddHotSpares []string `json:"externalHddHotSpares,omitempty"`
ExternalSsdHotSpares []string `json:"externalSsdHotSpares,omitempty"`
SizeToDiskMap SizeToDiskMap `json:"sizeToDiskMap,omitempty"`
}

type Attributes struct {
AdditionalProp1 string `json:"additionalProp1,omitempty"`
AdditionalProp2 string `json:"additionalProp2,omitempty"`
AdditionalProp3 string `json:"additionalProp3,omitempty"`
SizeToDiskMap map[string]int `json:"sizeToDiskMap,omitempty"`
}

type OptionsDetails struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
Dependencies []DependenciesDetails `json:"dependencies,omitempty"`
Attributes Attributes `json:"attributes,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
}

type ScaleIOStoragePoolDisks struct {
ProtectionDomainID string `json:"protectionDomainId,omitempty"`
ProtectionDomainName string `json:"protectionDomainName,omitempty"`
Expand Down Expand Up @@ -759,7 +742,7 @@ type ParametersDetails struct {
ScaleIODiskConfiguration ScaleIODiskConfiguration `json:"scaleIODiskConfiguration,omitempty"`
ProtectionDomainSettings []ProtectionDomainSettings `json:"protectionDomainSettings,omitempty"`
FaultSetSettings []FaultSetSettings `json:"faultSetSettings,omitempty"`
Attributes Attributes `json:"attributes,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
VdsConfiguration VdsConfiguration `json:"vdsConfiguration,omitempty"`
NodeSelection NodeSelection `json:"nodeSelection,omitempty"`
}
Expand Down Expand Up @@ -791,21 +774,17 @@ type AdditionalPropDetails struct {
ScaleIODiskConfiguration ScaleIODiskConfiguration `json:"scaleIODiskConfiguration,omitempty"`
ProtectionDomainSettings []ProtectionDomainSettings `json:"protectionDomainSettings,omitempty"`
FaultSetSettings []FaultSetSettings `json:"faultSetSettings,omitempty"`
Attributes Attributes `json:"attributes,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
VdsConfiguration VdsConfiguration `json:"vdsConfiguration,omitempty"`
NodeSelection NodeSelection `json:"nodeSelection,omitempty"`
}
type ParametersMap struct {
AdditionalProp1 AdditionalPropDetails `json:"additionalProp1,omitempty"`
AdditionalProp2 AdditionalPropDetails `json:"additionalProp2,omitempty"`
AdditionalProp3 AdditionalPropDetails `json:"additionalProp3,omitempty"`
}

type Resources struct {
GUID string `json:"guid,omitempty"`
ID string `json:"id,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Parameters []ParametersDetails `json:"parameters,omitempty"`
ParametersMap ParametersMap `json:"parametersMap,omitempty"`
ParametersMap map[string]string `json:"parametersMap,omitempty"`
}
type Components struct {
ID string `json:"id,omitempty"`
Expand All @@ -818,7 +797,7 @@ type Components struct {
Teardown bool `json:"teardown,omitempty"`
Type string `json:"type,omitempty"`
SubType string `json:"subType,omitempty"`
RelatedComponents RelatedComponents `json:"relatedComponents,omitempty"`
RelatedComponents map[string]string `json:"relatedComponents,omitempty"`
Resources []Resources `json:"resources,omitempty"`
Brownfield bool `json:"brownfield,omitempty"`
PuppetCertName string `json:"puppetCertName,omitempty"`
Expand Down Expand Up @@ -872,7 +851,7 @@ type Options struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Dependencies []DependenciesDetails `json:"dependencies,omitempty"`
Attributes Attributes `json:"attributes,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
}
type Parameters struct {
ID string `json:"id,omitempty"`
Expand Down

0 comments on commit 83a8183

Please sign in to comment.