Data plane per the computer use quickstart and SDK 2.6.0 source: signJwt minted JWT, /cdp /tabs /cdp_ws_endpoint over HTTP with routing headers, CDP over the live WsClient with capped reconnect. Operations methods wrapped, input/output chunk shapes settled from the SDK, ComputerUse moved off execute. Execution paths remain verified by Discovery, docs and SDK only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
39 lines
1.5 KiB
C++
39 lines
1.5 KiB
C++
#pragma once
|
|
|
|
// The operations methods Discovery offers on the three sandbox resources
|
|
// (sandboxEnvironments, sandboxEnvironmentTemplates, sandboxEnvironmentSnapshots):
|
|
// get, wait, cancel, delete (v1) and list (v1beta1 only). Lifecycle calls in
|
|
// this module already poll operations internally; these are the explicit,
|
|
// caller-driven forms. cancel and remove(delete) are explicit methods.
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "google/operation.h"
|
|
#include "google/sandbox/sandbox_service.h"
|
|
|
|
namespace molo::google::sandbox {
|
|
|
|
class Operations : public SandboxService {
|
|
public:
|
|
explicit Operations(std::shared_ptr<GoogleClient> client);
|
|
|
|
// GET {name}
|
|
Operation get(const std::string& operation_name) const;
|
|
// POST {name}:wait?timeout=Ns. Server-side wait of at most
|
|
// SandboxCaps::kMaxOperationWaitSeconds (1..), then returns the operation as
|
|
// it is (done or not).
|
|
Operation wait(const std::string& operation_name, int timeout_seconds) const;
|
|
// POST {name}:cancel (best effort on Google's side).
|
|
void cancel(const std::string& operation_name) const;
|
|
// DELETE {name}: removes the operation record, not the resource.
|
|
void remove(const std::string& operation_name) const;
|
|
// GET {resource}/operations (v1beta1), pages capped.
|
|
std::vector<Operation> list(const std::string& resource_name, int page_size = 0) const;
|
|
|
|
static clients::body::Json to_json(const Operation& op);
|
|
static std::string wait_query(int timeout_seconds); // "?timeout=30s"
|
|
};
|
|
|
|
} // namespace molo::google::sandbox
|