MCPcopy
hub / github.com/lxc/incus / GetOperationWait

Method GetOperationWait

client/incus_operations.go:89–107  ·  view source on GitHub ↗

GetOperationWait returns an Operation entry for the provided uuid once it's complete or hits the timeout.

(uuid string, timeout int)

Source from the content-addressed store, hash-verified

87
88// GetOperationWait returns an Operation entry for the provided uuid once it's complete or hits the timeout.
89func (r *ProtocolIncus) GetOperationWait(uuid string, timeout int) (*api.Operation, string, error) {
90 op := api.Operation{}
91
92 // Unset the response header timeout so that the request does not time out.
93 transport, err := r.getUnderlyingHTTPTransport()
94 if err != nil {
95 return nil, "", err
96 }
97
98 transport.ResponseHeaderTimeout = 0
99
100 // Fetch the raw value
101 etag, err := r.queryStruct("GET", fmt.Sprintf("/operations/%s/wait?timeout=%d", url.PathEscape(uuid), timeout), nil, "", &op)
102 if err != nil {
103 return nil, "", err
104 }
105
106 return &op, etag, nil
107}
108
109// GetOperationWaitSecret returns an Operation entry for the provided uuid and secret once it's complete or hits the timeout.
110func (r *ProtocolIncus) GetOperationWaitSecret(uuid string, secret string, timeout int) (*api.Operation, string, error) {

Callers

nothing calls this directly

Calls 2

queryStructMethod · 0.95

Tested by

no test coverage detected