Skip to content

Commit

Permalink
Merge pull request #29 from vmware-tanzu/topic/ecao/update-library-st…
Browse files Browse the repository at this point in the history
…ate-api

Include state info to content library resource status
  • Loading branch information
ericvmw authored Sep 25, 2024
2 parents 8d569f3 + fd6ae45 commit 271fd21
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
23 changes: 23 additions & 0 deletions api/v1alpha1/contentlibrary_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ const (
StorageBackingTypeOther StorageBackingType = "Other"
)

// State is a constant type that indicates the current state of a content library in vCenter.
type State string

const (
// StateActive indicates the library state when the library is fully functional, this is the default library state
// when a library is created.
StateActive State = "Active"

// StateMaintenance indicates the library state when the library is in migration. Content from the library may not
// be accessible and operations mutating library content will be disallowed in this state.
StateMaintenance State = "Maintenance"
)

// StorageBacking describes the default storage backing which is available for the library.
type StorageBacking struct {
// Type indicates the type of storage where the content would be stored.
Expand Down Expand Up @@ -86,6 +99,12 @@ type PublishInfo struct {
URL string `json:"URL"`
}

// StateInfo provides the information about the state of a content library.
type StateInfo struct {
// State indicates the state of this library.
State State `json:"state"`
}

// ContentLibrarySpec defines the desired state of a ContentLibrary.
type ContentLibrarySpec struct {
// UUID is the identifier which uniquely identifies the library in vCenter. This field is immutable.
Expand Down Expand Up @@ -146,6 +165,10 @@ type ContentLibraryStatus struct {
// +optional
SecurityPolicyID string `json:"securityPolicyID,omitempty"`

// StateInfo provides the state information of this library.
// +optional
StateInfo *StateInfo `json:"stateInfo,omitempty"`

// ServerGUID indicates the unique identifier of the vCenter server where the library exists.
// +optional
ServerGUID string `json:"serverGUID,omitempty"`
Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 271fd21

Please sign in to comment.