Documentation
¶
Index ¶
- type AtmosApiResponse
- type AtmosApiResponseData
- type CommitChanges
- type CommitFileAddition
- type CommitFileDeletion
- type CommitRequest
- type CommitResponse
- type Envelope
- type ExchangeGitHubOIDCTokenRequest
- type ExchangeGitHubOIDCTokenResponse
- type ExecDataUploadRequest
- type ExecDataUploadResponse
- type ExecUploadRequest
- type ExecUploadResponse
- type GetGitHubOIDCResponse
- type InstanceStatusUploadRequest
- type InstancesUploadRequest
- type LockStackRequest
- type LockStackResponse
- type ResourceUsageMetrics
- type UnlockStackRequest
- type UnlockStackResponse
- type UploadAffectedStacksRequest
- type UploadInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtmosApiResponse ¶
type AtmosApiResponse struct {
Request string `json:"request"`
Status int `json:"status"`
Success bool `json:"success"`
ErrorTag string `json:"errorTag,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
Error string `json:"error,omitempty"`
Context map[string]interface{} `json:"context,omitempty"`
TraceID string `json:"traceId,omitempty"`
Data *AtmosApiResponseData `json:"data,omitempty"`
}
AtmosApiResponse is the canonical envelope for all Atmos Pro API responses.
The server returns the user-facing failure description in `errorMessage` (camelCase). Older deployments may instead populate `error`; both are unmarshaled and EffectiveErrorMessage prefers `errorMessage` when present.
`data.validationErrors` carries a list of granular failure reasons (e.g. per-rule drift-detection violations) that are rendered as bullets to the user instead of being smushed into a single sentence.
func (*AtmosApiResponse) EffectiveErrorMessage ¶ added in v1.218.0
func (r *AtmosApiResponse) EffectiveErrorMessage() string
EffectiveErrorMessage returns ErrorMessage when populated, otherwise Error. This tolerates both the current server format (errorMessage) and legacy or future deployments that may use the simpler `error` field.
type AtmosApiResponseData ¶ added in v1.218.0
type AtmosApiResponseData struct {
ValidationErrors []string `json:"validationErrors,omitempty"`
}
AtmosApiResponseData carries auxiliary structured data on error responses. Typed responses that embed AtmosApiResponse and define their own `Data` field shadow this one (Go field promotion + JSON unmarshaling rules).
type CommitChanges ¶ added in v1.215.0
type CommitChanges struct {
Additions []CommitFileAddition `json:"additions"`
Deletions []CommitFileDeletion `json:"deletions"`
}
CommitChanges groups file additions and deletions for a commit.
type CommitFileAddition ¶ added in v1.215.0
type CommitFileAddition struct {
Path string `json:"path"`
Contents string `json:"contents"` // base64-encoded file contents.
}
CommitFileAddition represents a file to add or modify in the commit.
type CommitFileDeletion ¶ added in v1.215.0
type CommitFileDeletion struct {
Path string `json:"path"`
}
CommitFileDeletion represents a file to delete in the commit.
type CommitRequest ¶ added in v1.215.0
type CommitRequest struct {
Branch string `json:"branch"`
Changes CommitChanges `json:"changes"`
CommitMessage string `json:"commitMessage"`
Comment string `json:"comment,omitempty"`
}
CommitRequest is the request body for POST /api/v1/git/commit.
type CommitResponse ¶ added in v1.215.0
type CommitResponse struct {
AtmosApiResponse
Data struct {
SHA string `json:"sha"`
} `json:"data"`
}
CommitResponse is the response from POST /api/v1/git/commit.
type Envelope ¶ added in v1.221.0
type Envelope[T any] struct { AtmosApiResponse Data T `json:"data"` }
Envelope wraps any typed Atmos Pro response payload in the canonical envelope so callers read the payload from `data`, never the top level. See AtmosApiResponse for the envelope fields (success/status/errorMessage/...).
This is the generic form of the per-call shadow-Data DTOs (e.g. ExchangeGitHubOIDCTokenResponse): embedding AtmosApiResponse promotes its fields while the typed Data field shadows the embedded *AtmosApiResponseData so the payload decodes from `data` into T.
type ExchangeGitHubOIDCTokenRequest ¶
type ExchangeGitHubOIDCTokenRequest struct {
Token string `json:"token"`
WorkspaceID string `json:"workspaceId"`
}
ExchangeGitHubOIDCTokenRequest represents the request to exchange OIDC token for Atmos token.
type ExchangeGitHubOIDCTokenResponse ¶
type ExchangeGitHubOIDCTokenResponse struct {
AtmosApiResponse
Data struct {
Token string `json:"token"`
} `json:"data"`
}
ExchangeGitHubOIDCTokenResponse represents the response from Atmos Pro's OIDC auth endpoint.
type ExecDataUploadRequest ¶
type ExecDataUploadRequest struct {
// ExecutionID MUST match the corresponding ExecUploadRequest.ExecutionID,
// so Atmos Pro can associate this blob with that execution record.
ExecutionID string `json:"execution_id"`
Data json.RawMessage `json:"data"`
}
ExecDataUploadRequest is the request body for POST /v1/atmos/exec/data, used to upload a command's structured Data out-of-band, in a single request (never chunked), when the parent ExecUploadRequest would otherwise exceed the payload size threshold (FR-011).
type ExecDataUploadResponse ¶
type ExecDataUploadResponse struct {
AtmosApiResponse
URL string `json:"url"`
}
ExecDataUploadResponse represents the response from POST /v1/atmos/exec/data. URL is the blob's retrievable location, to be set as the corresponding ExecUploadRequest.Data content (as a JSON string) on the subsequent POST /v1/atmos/exec request.
type ExecUploadRequest ¶
type ExecUploadRequest struct {
// ExecutionID uniquely identifies this single execution record — a fresh
// UUID v4 generated once per qualifying invocation. Distinct from
// AtmosProRunID, which correlates records across a whole CI run. Also
// sent as ExecDataUploadRequest.ExecutionID when Data requires
// out-of-band delivery, so Atmos Pro can associate the two (FR-003c).
ExecutionID string `json:"execution_id"`
AtmosProRunID string `json:"atmos_pro_run_id"`
AtmosVersion string `json:"atmos_version"`
AtmosOS string `json:"atmos_os"`
AtmosArch string `json:"atmos_arch"`
Command string `json:"command"`
// Args holds only the invocation's positional arguments (e.g. the
// component identifier). CLI flags are reported separately in Flags —
// the two are never combined into one array (FR-003b).
Args []string `json:"args"`
// Flags holds the CLI flags actually passed (e.g. "-s", "plat-use2-dev"),
// masked the same way Args is. Kept distinct from Args per FR-003b so the
// two remain correlatable in content with the older, independent
// uploadStatus mechanism (internal/exec/pro.go) without merging shapes.
Flags []string `json:"flags"`
ExitCode int `json:"exit_code"`
GitSHA string `json:"git_sha"`
RepoURL string `json:"repo_url"`
RepoName string `json:"repo_name"`
RepoOwner string `json:"repo_owner"`
RepoHost string `json:"repo_host"`
Metrics ResourceUsageMetrics `json:"metrics"`
// Data is command-specific structured data (e.g. terraform plan/apply
// resource counts, outputs, warnings, and per-resource change lists).
// Absent (nil) for commands with no structured-data extension, per
// FR-005/data-model.md. On the wire it is always exactly one of two
// shapes: an inline JSON structure (object/array), when the whole
// marshaled record is under the payload size threshold; or a JSON
// string holding a blob URL returned by POST /v1/atmos/exec/data, when
// the whole record is at/over the threshold (FR-011). Never chunked —
// UploadExecMetadata decides which shape to send, never both.
Data json.RawMessage `json:"data,omitempty"`
}
ExecUploadRequest represents the data structure for uploading a single command-execution record to Atmos Pro. This is an allowlist — new fields must be explicitly added here. Sensitive data is masked before this struct is marshaled (see pkg/proexec).
type ExecUploadResponse ¶
type ExecUploadResponse struct {
AtmosApiResponse
}
ExecUploadResponse represents the response from POST /v1/atmos/exec.
type GetGitHubOIDCResponse ¶
type GetGitHubOIDCResponse struct {
Value string `json:"value"`
}
GetGitHubOIDCResponse represents the response from GitHub's OIDC token endpoint when requesting an OIDC token.
type InstanceStatusUploadRequest ¶ added in v1.192.0
type InstanceStatusUploadRequest struct {
AtmosProRunID string `json:"atmos_pro_run_id"`
AtmosVersion string `json:"atmos_version"`
AtmosOS string `json:"atmos_os"`
AtmosArch string `json:"atmos_arch"`
GitSHA string `json:"git_sha"`
RepoURL string `json:"repo_url"`
RepoName string `json:"repo_name"`
RepoOwner string `json:"repo_owner"`
RepoHost string `json:"repo_host"`
Component string `json:"component"`
Stack string `json:"stack"`
Command string `json:"command"`
ExitCode int `json:"exit_code"`
}
InstanceStatusUploadRequest represents the data structure for uploading a single instance's status.
type InstancesUploadRequest ¶ added in v1.192.0
type InstancesUploadRequest struct {
RepoURL string `json:"repo_url"`
RepoName string `json:"repo_name"`
RepoOwner string `json:"repo_owner"`
RepoHost string `json:"repo_host"`
Instances []UploadInstance `json:"instances"`
BatchID string `json:"batch_id,omitempty"`
BatchIndex *int `json:"batch_index,omitempty"`
BatchTotal *int `json:"batch_total,omitempty"`
}
InstancesUploadRequest represents the data structure for uploading components for drift detection. We call this from "atmos list instances".
type LockStackRequest ¶
type LockStackResponse ¶
type LockStackResponse struct {
AtmosApiResponse
Data struct {
ID string `json:"id,omitempty"`
WorkspaceId string `json:"workspaceId,omitempty"`
Key string `json:"key,omitempty"`
LockMessage string `json:"lockMessage,omitempty"`
ExpiresAt time.Time `json:"expiresAt,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
DeletedAt time.Time `json:"deletedAt,omitempty"`
} `json:"data"`
}
type ResourceUsageMetrics ¶
type ResourceUsageMetrics struct {
WallTimeMS int64 `json:"wall_time_ms"`
UserCPUTimeMS int64 `json:"user_cpu_time_ms"`
SystemCPUTimeMS int64 `json:"system_cpu_time_ms"`
MaxRSSBytes int64 `json:"max_rss_bytes,omitempty"`
MinorPageFaults int64 `json:"minor_page_faults,omitempty"`
MajorPageFaults int64 `json:"major_page_faults,omitempty"`
InBlockOps int64 `json:"in_block_ops,omitempty"`
OutBlockOps int64 `json:"out_block_ops,omitempty"`
VolCtxSwitches int64 `json:"vol_ctx_switches,omitempty"`
InvolCtxSwitches int64 `json:"invol_ctx_switches,omitempty"`
}
ResourceUsageMetrics captures how much time and system resources a command consumed while running. This is an allowlist — new fields must be explicitly added here. Unix-only fields are omitted on platforms without support.
type UnlockStackRequest ¶
type UnlockStackRequest struct {
Key string `json:"key"`
}
type UnlockStackResponse ¶
type UnlockStackResponse struct {
AtmosApiResponse
Data struct{} `json:"data"`
}
type UploadAffectedStacksRequest ¶
type UploadAffectedStacksRequest struct {
HeadSHA string `json:"head_sha"`
BaseSHA string `json:"base_sha"`
RepoURL string `json:"repo_url"`
RepoName string `json:"repo_name"`
RepoOwner string `json:"repo_owner"`
RepoHost string `json:"repo_host"`
Stacks []schema.Affected `json:"stacks"`
BatchID string `json:"batch_id,omitempty"`
BatchIndex *int `json:"batch_index,omitempty"`
BatchTotal *int `json:"batch_total,omitempty"`
}
type UploadInstance ¶ added in v1.214.0
type UploadInstance struct {
Component string `json:"component"`
Stack string `json:"stack"`
ComponentType string `json:"component_type"`
Settings map[string]any `json:"settings,omitempty"`
}
UploadInstance contains only the fields that Atmos Pro needs from an instance. This is an allowlist — new fields must be explicitly added here. Sensitive data (vars, env, backend) is never included.