GetOperationWait returns an Operation entry for the provided uuid once it's complete or hits the timeout.
(uuid string, timeout int)
| 87 | |
| 88 | // GetOperationWait returns an Operation entry for the provided uuid once it's complete or hits the timeout. |
| 89 | func (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. |
| 110 | func (r *ProtocolIncus) GetOperationWaitSecret(uuid string, secret string, timeout int) (*api.Operation, string, error) { |
nothing calls this directly
no test coverage detected