-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from s-amann/adds-subscription-endpoint
adds a new subscription endpoint to save to cache
- Loading branch information
Showing
4 changed files
with
128 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package subscription | ||
|
||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the Apache License 2.0. | ||
|
||
import ( | ||
"github.com/Azure/ARO-HCP/internal/api" | ||
) | ||
|
||
type version struct{} | ||
|
||
// NewHCPOpenShiftCluster implements api.Version. | ||
func (v version) NewHCPOpenShiftCluster(*api.HCPOpenShiftCluster) api.VersionedHCPOpenShiftCluster { | ||
panic("'System Version 2.0' is not supported for HCP Cluster objects") | ||
} | ||
|
||
// UnmarshalHCPOpenShiftCluster implements api.Version. | ||
func (v version) UnmarshalHCPOpenShiftCluster([]byte, bool, *api.HCPOpenShiftCluster) error { | ||
panic("'System Version 2.0' is not supported for HCP Cluster objects") | ||
} | ||
|
||
// String returns the api-version parameter value for this API. | ||
func (v version) String() string { | ||
return "2.0" | ||
} | ||
|
||
func init() { | ||
api.Register(version{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package subscription | ||
|
||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the Apache License 2.0. | ||
|
||
type Subscription struct { | ||
State RegistrationState `json:"state"` | ||
RegsitrationDate *string `json:"registrationDate,omitempty"` | ||
Properties *Properties `json:"properties,omitempty"` | ||
} | ||
|
||
type Properties struct { | ||
TenantId *string `json:"tenantId,omitempty"` | ||
LocationPlacementId *string `json:"locationPlacementId,omitempty"` | ||
QuotaId *string `json:"quotaId,omitempty"` | ||
RegisteredFeatures *[]Feature `json:"registeredFeatures,omitempty"` | ||
AvailabilityZones *AvailabilityZone `json:"availabilityZones,omitempty"` | ||
SpendingLimit *string `json:"spendingLimit,omitempty"` | ||
AccountOwner *map[string]string `json:"accountOwner,omitempty"` | ||
ManagedByTenants *[]map[string]string `json:"managedByTenants,omitempty"` | ||
AdditionalProperties *map[string]string `json:"additionalProperties,omitempty"` | ||
} | ||
|
||
type Feature struct { | ||
Name *string `json:"name,omitempty"` | ||
State *string `json:"state,omitempty"` | ||
} | ||
|
||
type AvailabilityZone struct { | ||
Location *string `json:"location,omitempty"` | ||
ZoneMappings *[]ZoneMapping `json:"zoneMppings,omitempty"` | ||
} | ||
|
||
type ZoneMapping struct { | ||
LogicalZone *string `json:"logicalZone,omitempty"` | ||
PhysicalZone *string `json:"physicalZone,omitempty"` | ||
} | ||
type RegistrationState string | ||
|
||
const ( | ||
Registered RegistrationState = "Registered" | ||
Unregistered RegistrationState = "Unregistered" | ||
Warned RegistrationState = "Warned" | ||
Deleted RegistrationState = "Deleted" | ||
Suspended RegistrationState = "Suspended" | ||
) |