Documentation ¶
Index ¶
- type Client
- func (client *Client) Create(id, owner string, params *model.VmCreateParams) (*model.VM, error)
- func (client *Client) DeleteSubsystem(id, key string) error
- func (client *Client) GetUsage() (*model.VmUsage, error)
- func (client *Client) IncludeDeletedResources() *Client
- func (client *Client) LastAccessedBefore(timestamp time.Time) *Client
- func (client *Client) ListWithAnyPendingCustomDomain() ([]model.VM, error)
- func (client *Client) MarkAccessed(id string) error
- func (client *Client) MarkRepaired(id string) error
- func (client *Client) MarkUpdated(id string) error
- func (client *Client) OlderThan(timestamp time.Time) *Client
- func (client *Client) SetCurrentHost(name string, host *model.VmHost) error
- func (client *Client) SetStatusByName(name, status string) error
- func (client *Client) SetSubsystem(id, key string, update interface{}) error
- func (client *Client) UnsetCurrentHost(name string) error
- func (client *Client) UpdateCustomDomainStatus(id, portName, status string) error
- func (client *Client) UpdateWithParams(id string, params *model.VmUpdateParams) error
- func (client *Client) WithActivities(activities ...string) *Client
- func (client *Client) WithCustomFilter(filter bson.D) *Client
- func (client *Client) WithIDs(ids ...string) *Client
- func (client *Client) WithNameRegex(name string) *Client
- func (client *Client) WithNoActivities() *Client
- func (client *Client) WithOwner(ownerID string) *Client
- func (client *Client) WithPagination(page, pageSize int) *Client
- func (client *Client) WithVersion(version string) *Client
- func (client *Client) WithZone(zone ...string) *Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Collection *mongo.Collection RestrictUserID *string Version *string base_clients.ActivityResourceClient[model.VM] base_clients.ResourceClient[model.VM] }
Client is used to manage VMs in the database.
func (*Client) DeleteSubsystem ¶
DeleteSubsystem erases a subsystem from a VM. It prepends the key with `subsystems` and unsets it.
func (*Client) IncludeDeletedResources ¶
IncludeDeletedResources makes the client include deleted VMs.
func (*Client) LastAccessedBefore ¶
LastAccessedBefore adds a filter to the client to only return VMs that were last accessed before the given timestamp.
func (*Client) ListWithAnyPendingCustomDomain ¶
ListWithAnyPendingCustomDomain returns a list of VMs that have any port with a pending custom domain. It uses aggregation to do this, so it is not very efficient.
func (*Client) MarkAccessed ¶
MarkAccessed marks a deployment as accessed to the current time.
func (*Client) MarkRepaired ¶
MarkRepaired marks a VM as repaired. It sets RepairedAt and unsets the repairing activity.
func (*Client) MarkUpdated ¶
MarkUpdated marks a VM as updated. It sets UpdatedAt and unsets the updating activity.
func (*Client) OlderThan ¶
OlderThan adds a filter to the client to only return VMs created before the given timestamp.
func (*Client) SetCurrentHost ¶
SetCurrentHost sets the current host of a VM.
func (*Client) SetStatusByName ¶
SetStatusByName sets the status of a deployment.
func (*Client) SetSubsystem ¶
SetSubsystem sets a subsystem in a VM. It prepends the key with `subsystems` and sets it.
func (*Client) UnsetCurrentHost ¶
UnsetCurrentHost unsets the current host of a VM.
func (*Client) UpdateCustomDomainStatus ¶
UpdateCustomDomainStatus updates the status of a custom domain for a given port.
func (*Client) UpdateWithParams ¶
func (client *Client) UpdateWithParams(id string, params *model.VmUpdateParams) error
func (*Client) WithActivities ¶
WithActivities adds a filter to the client to only return VMs that have the given activities.
func (*Client) WithCustomFilter ¶
WithCustomFilter adds a custom filter to the client.
func (*Client) WithNameRegex ¶
WithNameRegex adds a filter to the client to only return VMs with names matching the given regex.
func (*Client) WithNoActivities ¶
WithNoActivities adds a filter to the client to only return VMs that have no activities.
func (*Client) WithOwner ¶
WithOwner adds a filter to the client to only return VMs owned by the given ownerID.
func (*Client) WithPagination ¶
WithPagination adds pagination to the client.
func (*Client) WithVersion ¶
WithVersion adds a filter to the client to only return VMs with the given version.