Documentation
¶
Overview ¶
Package server provides access to the `/cloud/stack/server` API endpoint.
Index ¶
- type Client
- func (s *Client) GetUpdateWindow(ctx context.Context, request GetUpdateWindowRequest) (response GetUpdateWindowResponse, err error)
- func (s *Client) List(ctx context.Context) (response ListResponse, err error)
- func (s *Client) SetUpdateWindow(ctx context.Context, request SetUpdateWindowRequest) (response JobResponse, err error)
- func (s *Client) UpdateMinimumTLSVersion(ctx context.Context, request UpdateMinimumTLSVersionRequest) (response JobResponse, err error)
- type GetUpdateWindowRequest
- type GetUpdateWindowResponse
- type JobResponse
- type ListResponse
- type SetUpdateWindowRequest
- type UpdateMinimumTLSVersionRequest
- type UpdateWindow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Service to work with API Jobs.
func (*Client) GetUpdateWindow ¶ added in v0.7.0
func (s *Client) GetUpdateWindow(ctx context.Context, request GetUpdateWindowRequest) (response GetUpdateWindowResponse, err error)
GetUpdateWindow reads the maintenance/patching window configuration for the named CCS via "cloud/server/get_update_window.json".
Note: this endpoint returns "This server is not managed by SiteHost" for managed=0 servers — only managed CCSes have a configured window.
func (*Client) List ¶
func (s *Client) List(ctx context.Context) (response ListResponse, err error)
List returns a list of stack servers.
func (*Client) SetUpdateWindow ¶ added in v0.7.0
func (s *Client) SetUpdateWindow(ctx context.Context, request SetUpdateWindowRequest) (response JobResponse, err error)
SetUpdateWindow configures the maintenance/patching window for the named CCS via "cloud/server/set_update_window.json". Returns a scheduler job; SDK consumers should poll until state=Completed.
All five fields (ServerName, Enabled, DayOfWeek, HourOfDay, MinuteOfHour) are required — the API rejects with "Could not find a default value for the parameter '<field>'" if any are omitted.
func (*Client) UpdateMinimumTLSVersion ¶ added in v0.7.0
func (s *Client) UpdateMinimumTLSVersion(ctx context.Context, request UpdateMinimumTLSVersionRequest) (response JobResponse, err error)
UpdateMinimumTLSVersion sets the minimum TLS version the named CCS's nginx-proxy will negotiate via "cloud/server/update_minimum_tls_version.json". Returns a scheduler job.
MinimumTLSVersion must be in the "TLSv1.x" format (e.g. "TLSv1.1", "TLSv1.2", "TLSv1.3"); other formats like "1.2" or "TLS_1_2" are rejected with "The minimum tls version is not valid."
**There's no corresponding read endpoint.** Once set, the value is observable only via TLS handshake against a service running on the CCS, or by tracking the value in your own state.
**Affects all stacks on the CCS.** This is a server-wide setting that controls TLS termination at nginx-proxy for every customer site running on the CCS. Tightening from the platform default (TLSv1.1) will reject older TLS clients across all customer sites.
type GetUpdateWindowRequest ¶ added in v0.7.0
type GetUpdateWindowRequest struct {
ServerName string `url:"server_name"`
}
GetUpdateWindowRequest identifies the CCS whose update-window configuration to read.
type GetUpdateWindowResponse ¶ added in v0.7.0
type GetUpdateWindowResponse struct {
Return UpdateWindow `json:"return"`
models.APIResponse
}
GetUpdateWindowResponse is the response from cloud/server/get_update_window.json. Returns the current maintenance-window configuration.
type JobResponse ¶ added in v0.7.0
type JobResponse struct {
Return struct {
models.Job `json:"job"`
} `json:"return"`
models.APIResponse
}
JobResponse is the shared response shape for the asynchronous write operations: SetUpdateWindow, UpdateMinimumTLSVersion. Each queues a scheduler job; the job ID is returned for tracking.
type ListResponse ¶
type ListResponse struct {
CloudServers []models.CloudServer `json:"return"`
models.APIResponse
}
ListResponse represents a server response for listing stack servers.
type SetUpdateWindowRequest ¶ added in v0.7.0
type SetUpdateWindowRequest struct {
ServerName string `url:"server_name"`
Enabled int `url:"enabled"` // 0 or 1
DayOfWeek int `url:"day_of_week"`
HourOfDay int `url:"hour_of_day"`
MinuteOfHour int `url:"minute_of_hour"`
}
SetUpdateWindowRequest configures the maintenance / patching window for a CCS. All fields are required by the API.
DayOfWeek is 1–7 (1 = Monday); HourOfDay is 0–23; MinuteOfHour is 0–59. Enabled controls whether the window is active (false disables auto-maintenance).
type UpdateMinimumTLSVersionRequest ¶ added in v0.7.0
type UpdateMinimumTLSVersionRequest struct {
ServerName string `url:"server_name"`
MinimumTLSVersion string `url:"minimum_tls_version"`
}
UpdateMinimumTLSVersionRequest sets the minimum TLS version the CCS's nginx-proxy will negotiate. The API accepts the "TLSv1.x" format (e.g. "TLSv1.1", "TLSv1.2", "TLSv1.3"); values like "1.2" or "TLS_1_2" are rejected.
Note: there's no corresponding read endpoint. Consumers must either track the value they set or observe it via a TLS handshake against a service running on the CCS.
type UpdateWindow ¶ added in v0.7.0
type UpdateWindow struct {
Enabled bool `json:"enabled"`
DayOfWeek int `json:"day_of_week"`
HourOfDay int `json:"hour_of_day"`
MinuteOfHour int `json:"minute_of_hour"`
}
UpdateWindow describes a CCS's maintenance/patching window configuration as returned by get_update_window. DayOfWeek is 1–7 (1 = Monday); HourOfDay is 0–23; MinuteOfHour is 0–59.