Documentation
¶
Index ¶
- type Account
- type AccountCreateRequestBody
- type AccountFeature
- type AccountResponse
- type AsyncTask
- type AsyncTaskResponse
- type Client
- func NewAPIClient(baseURL, version, apiKey, apiSecret string) (*Client, error)
- func NewAPIClientWithAccount(baseURL, version, apiKey, apiSecret, accountID string) (*Client, error)
- func NewBasicAuthClient(baseURL, version, username, password string) (*Client, error)
- func NewClient(baseURL, version string, options ...ClientOption) (*Client, error)
- func (c *Client) AddFeatureToAccount(accountID string, body *FeatureRequest) (*FeatureRequestResponse, error)
- func (c *Client) CreateAccount(body *AccountCreateRequestBody) (*AccountResponse, error)
- func (c *Client) CreateCredential() (*CredentialResponse, error)
- func (c *Client) CreateExecutor(body *ExecutorRequestBody) (*ExecutorResponse, error)
- func (c *Client) CreateJob(body *JobRequestBody) (*JobResponse, error)
- func (c *Client) CreateProject(body *ProjectRequestBody) (*ProjectResponse, error)
- func (c *Client) DeleteCredential(id string) error
- func (c *Client) DeleteExecutor(id string) error
- func (c *Client) DeleteJob(id string) error
- func (c *Client) DeleteProject(id string) error
- func (c *Client) GetAccount(id string) (*AccountResponse, error)
- func (c *Client) GetAsyncTask(requestID string) (*AsyncTaskResponse, error)
- func (c *Client) GetCredential(id string) (*CredentialResponse, error)
- func (c *Client) GetExecutor(id string) (*ExecutorResponse, error)
- func (c *Client) GetJob(id string) (*JobResponse, error)
- func (c *Client) GetProject(id string) (*ProjectResponse, error)
- func (c *Client) Healthcheck() (*HealthcheckResponse, error)
- func (c *Client) ListCredentials(limit, offset int, orderBy, orderByDirection string) (*PaginatedCredentialsResponse, error)
- func (c *Client) ListExecutions(startDate, endDate string, projectID, jobID int64, limit, offset int) (*PaginatedExecutionsResponse, error)
- func (c *Client) ListExecutors(limit, offset int, orderBy, orderByDirection string) (*PaginatedExecutorsResponse, error)
- func (c *Client) ListFeatures() (*FeaturesResponse, error)
- func (c *Client) ListJobs(projectID string, limit, offset int, orderBy, orderByDirection string) (*PaginatedJobsResponse, error)
- func (c *Client) ListProjects(limit, offset int) (*PaginatedProjectsResponse, error)
- func (c *Client) RemoveFeatureFromAccount(accountID string, body *FeatureRequest) error
- func (c *Client) UpdateCredential(id string) (*CredentialResponse, error)
- func (c *Client) UpdateExecutor(id string, body *ExecutorRequestBody) (*ExecutorResponse, error)
- func (c *Client) UpdateJob(id string, body *JobUpdateRequestBody) (*JobResponse, error)
- func (c *Client) UpdateProject(id string, body *ProjectUpdateRequestBody) (*ProjectResponse, error)
- type ClientOption
- type Credential
- type CredentialResponse
- type Execution
- type ExecutionResponse
- type Executor
- type ExecutorRequestBody
- type ExecutorResponse
- type Feature
- type FeatureRequest
- type FeatureRequestResponse
- type FeaturesResponse
- type HealthcheckData
- type HealthcheckResponse
- type Job
- type JobRequestBody
- type JobResponse
- type JobUpdateRequestBody
- type PaginatedCredentialsResponse
- type PaginatedExecutionsResponse
- type PaginatedExecutorsResponse
- type PaginatedJobsResponse
- type PaginatedProjectsResponse
- type Project
- type ProjectRequestBody
- type ProjectResponse
- type ProjectUpdateRequestBody
- type RaftStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID int64 `json:"id"`
Name string `json:"name"`
Features []AccountFeature `json:"features"`
DateCreated string `json:"dateCreated"`
DateModified *string `json:"dateModified"`
}
Account represents an account
type AccountCreateRequestBody ¶
type AccountCreateRequestBody struct {
Name string `json:"name"`
}
AccountCreateRequestBody represents the request body for creating an account
type AccountFeature ¶
type AccountFeature struct {
AccountID int64 `json:"accountId"`
FeatureID int64 `json:"featureId"`
Feature string `json:"feature"`
}
AccountFeature represents a feature associated with an account
type AccountResponse ¶
AccountResponse represents the response for a single account
type AsyncTask ¶
type AsyncTask struct {
ID int64 `json:"id"`
RequestID string `json:"requestId"`
Input string `json:"input"`
Output string `json:"output"`
Service string `json:"service"`
State int `json:"state"`
DateCreated string `json:"dateCreated"`
}
AsyncTask represents an async task
type AsyncTaskResponse ¶
AsyncTaskResponse represents the response for a single async task
type Client ¶
type Client struct {
BaseURL *url.URL
HTTPClient *http.Client
APIKey string
APISecret string
Version string
// Basic Auth for peer communication
Username string
Password string
// Account ID for most endpoints
AccountID string
}
func NewAPIClient ¶
NewAPIClient creates a client with API key authentication
func NewAPIClientWithAccount ¶
func NewAPIClientWithAccount(baseURL, version, apiKey, apiSecret, accountID string) (*Client, error)
NewAPIClientWithAccount creates a client with API key authentication and account ID
func NewBasicAuthClient ¶
NewBasicAuthClient creates a client with basic authentication for peer communication
func (*Client) AddFeatureToAccount ¶
func (c *Client) AddFeatureToAccount(accountID string, body *FeatureRequest) (*FeatureRequestResponse, error)
AddFeatureToAccount adds a feature to an account
func (*Client) CreateAccount ¶
func (c *Client) CreateAccount(body *AccountCreateRequestBody) (*AccountResponse, error)
CreateAccount creates a new account
func (*Client) CreateCredential ¶
func (c *Client) CreateCredential() (*CredentialResponse, error)
CreateCredential creates a new credential
func (*Client) CreateExecutor ¶
func (c *Client) CreateExecutor(body *ExecutorRequestBody) (*ExecutorResponse, error)
CreateExecutor creates a new executor
func (*Client) CreateJob ¶
func (c *Client) CreateJob(body *JobRequestBody) (*JobResponse, error)
CreateJob creates a new job
func (*Client) CreateProject ¶
func (c *Client) CreateProject(body *ProjectRequestBody) (*ProjectResponse, error)
CreateProject creates a new project
func (*Client) DeleteCredential ¶
DeleteCredential deletes a credential by ID
func (*Client) DeleteExecutor ¶
DeleteExecutor deletes an executor by ID
func (*Client) DeleteProject ¶
DeleteProject deletes a project by ID
func (*Client) GetAccount ¶
func (c *Client) GetAccount(id string) (*AccountResponse, error)
GetAccount retrieves a single account by ID
func (*Client) GetAsyncTask ¶
func (c *Client) GetAsyncTask(requestID string) (*AsyncTaskResponse, error)
GetAsyncTask retrieves an async task by request ID
func (*Client) GetCredential ¶
func (c *Client) GetCredential(id string) (*CredentialResponse, error)
GetCredential retrieves a single credential by ID
func (*Client) GetExecutor ¶
func (c *Client) GetExecutor(id string) (*ExecutorResponse, error)
GetExecutor retrieves a single executor by ID
func (*Client) GetJob ¶
func (c *Client) GetJob(id string) (*JobResponse, error)
GetJob retrieves a single job by ID
func (*Client) GetProject ¶
func (c *Client) GetProject(id string) (*ProjectResponse, error)
GetProject retrieves a single project by ID
func (*Client) Healthcheck ¶
func (c *Client) Healthcheck() (*HealthcheckResponse, error)
Healthcheck retrieves the current leader and raft stats (no authentication required)
func (*Client) ListCredentials ¶
func (c *Client) ListCredentials(limit, offset int, orderBy, orderByDirection string) (*PaginatedCredentialsResponse, error)
func (*Client) ListExecutions ¶
func (c *Client) ListExecutions(startDate, endDate string, projectID, jobID int64, limit, offset int) (*PaginatedExecutionsResponse, error)
ListExecutions retrieves job executions with query parameters
func (*Client) ListExecutors ¶
func (c *Client) ListExecutors(limit, offset int, orderBy, orderByDirection string) (*PaginatedExecutorsResponse, error)
ListExecutors retrieves all executors with optional query parameters
func (*Client) ListFeatures ¶
func (c *Client) ListFeatures() (*FeaturesResponse, error)
ListFeatures retrieves all available features
func (*Client) ListJobs ¶
func (c *Client) ListJobs(projectID string, limit, offset int, orderBy, orderByDirection string) (*PaginatedJobsResponse, error)
ListJobs retrieves all jobs with optional query parameters
func (*Client) ListProjects ¶
func (c *Client) ListProjects(limit, offset int) (*PaginatedProjectsResponse, error)
ListProjects retrieves all projects with optional query parameters
func (*Client) RemoveFeatureFromAccount ¶
func (c *Client) RemoveFeatureFromAccount(accountID string, body *FeatureRequest) error
RemoveFeatureFromAccount removes a feature from an account
func (*Client) UpdateCredential ¶
func (c *Client) UpdateCredential(id string) (*CredentialResponse, error)
UpdateCredential updates an existing credential
func (*Client) UpdateExecutor ¶
func (c *Client) UpdateExecutor(id string, body *ExecutorRequestBody) (*ExecutorResponse, error)
UpdateExecutor updates an existing executor
func (*Client) UpdateJob ¶
func (c *Client) UpdateJob(id string, body *JobUpdateRequestBody) (*JobResponse, error)
UpdateJob updates an existing job
func (*Client) UpdateProject ¶
func (c *Client) UpdateProject(id string, body *ProjectUpdateRequestBody) (*ProjectResponse, error)
UpdateProject updates an existing project
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a function that configures a Client
func WithAPIKey ¶
func WithAPIKey(apiKey, apiSecret string) ClientOption
WithAPIKey sets the API key and secret for authentication
func WithAccountID ¶
func WithAccountID(accountID string) ClientOption
WithAccountID sets the account ID for requests
func WithBasicAuth ¶
func WithBasicAuth(username, password string) ClientOption
WithBasicAuth sets the username and password for basic authentication
type Credential ¶
type CredentialResponse ¶
type CredentialResponse struct {
Success bool `json:"success"`
Data Credential `json:"data"`
}
CredentialResponse represents the response for a single credential
type Execution ¶
type Execution struct {
ID int `json:"id"`
UniqueID string `json:"uniqueId"`
State string `json:"state"`
NodeID string `json:"nodeId"`
JobID string `json:"jobId"`
LastExecutionTime string `json:"lastExecutionDatetime"`
NextExecutionTime string `json:"nextExecutionDatetime"`
JobQueueVersion int `json:"jobQueueVersion"`
ExecutionVersion int `json:"executionVersion"`
Logs string `json:"logs"`
CreatedAt string `json:"date_created"`
}
Execution represents a job execution log
type ExecutionResponse ¶
ExecutionResponse represents the response for a single execution
type Executor ¶
type Executor struct {
ID int64 `json:"id"`
AccountID int64 `json:"accountId"`
Name string `json:"name"`
Type string `json:"type"`
Region string `json:"region"`
CloudProvider string `json:"cloudProvider"`
CloudResourceURL string `json:"cloudResourceUrl"`
CloudAPIKey string `json:"cloudApiKey"`
CloudAPISecret string `json:"cloudApiSecret"`
WebhookURL string `json:"webhookUrl"`
WebhookSecret string `json:"webhookSecret"`
WebhookMethod string `json:"webhookMethod"`
DateCreated string `json:"dateCreated"`
DateModified *string `json:"dateModified"`
DateDeleted *string `json:"dateDeleted"`
CreatedBy string `json:"createdBy"`
ModifiedBy *string `json:"modifiedBy"`
DeletedBy *string `json:"deletedBy"`
}
Executor represents a job executor
type ExecutorRequestBody ¶
type ExecutorRequestBody struct {
Name string `json:"name"`
Type string `json:"type"`
Region string `json:"region"`
CloudProvider string `json:"cloudProvider"`
CloudResourceURL string `json:"cloudResourceUrl"`
CloudAPIKey string `json:"cloudApiKey,omitempty"`
CloudAPISecret string `json:"cloudApiSecret,omitempty"`
WebhookURL string `json:"webhookUrl,omitempty"`
WebhookSecret string `json:"webhookSecret,omitempty"`
WebhookMethod string `json:"webhookMethod,omitempty"`
}
ExecutorRequestBody represents the request body for creating/updating an executor
type ExecutorResponse ¶
ExecutorResponse represents the response for a single executor
type Feature ¶
type Feature struct {
ID int64 `json:"id"`
Name string `json:"name"`
DateCreated string `json:"dateCreated"`
DateModified *string `json:"dateModified"`
}
Feature represents a feature
type FeatureRequest ¶
type FeatureRequest struct {
FeatureID int64 `json:"featureId"`
}
FeatureRequest represents a request to add/remove a feature
type FeatureRequestResponse ¶
type FeatureRequestResponse struct {
Success bool `json:"success"`
Data FeatureRequest `json:"data"`
}
FeatureRequestResponse represents the response for feature operations
type FeaturesResponse ¶
FeaturesResponse represents the response for listing features
type HealthcheckData ¶
type HealthcheckData struct {
LeaderAddress string `json:"leaderAddress"`
LeaderID string `json:"leaderId"`
RaftStats RaftStats `json:"raftStats"`
}
HealthcheckData represents the healthcheck response data
type HealthcheckResponse ¶
type HealthcheckResponse struct {
Success bool `json:"success"`
Data HealthcheckData `json:"data"`
}
HealthcheckResponse represents the healthcheck response
type Job ¶
type Job struct {
ID int64 `json:"id,omitempty"`
AccountID int64 `json:"accountId,omitempty"`
ProjectID int64 `json:"projectId,omitempty"`
ExecutorID *int64 `json:"executorId,omitempty"`
Data string `json:"data,omitempty"`
Spec string `json:"spec,omitempty"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
LastExecutionDate string `json:"lastExecutionDate,omitempty"`
Timezone string `json:"timezone,omitempty"`
TimezoneOffset int64 `json:"timezoneOffset,omitempty"`
RetryMax int `json:"retryMax,omitempty"`
ExecutionID string `json:"executionId,omitempty"`
Status string `json:"status,omitempty"`
DateCreated string `json:"dateCreated,omitempty"`
DateModified *string `json:"dateModified,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
ModifiedBy *string `json:"modifiedBy,omitempty"`
DeletedBy *string `json:"deletedBy,omitempty"`
}
Job represents a scheduled job
type JobRequestBody ¶
type JobRequestBody struct {
ProjectID int64 `json:"projectId"`
Timezone string `json:"timezone"`
ExecutorID *int64 `json:"executorId,omitempty"`
Data string `json:"data,omitempty"`
Spec string `json:"spec,omitempty"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
TimezoneOffset int64 `json:"timezoneOffset,omitempty"`
RetryMax int `json:"retryMax,omitempty"`
Status string `json:"status,omitempty"`
}
JobRequestBody represents the request body for creating a job
type JobResponse ¶
JobResponse represents the response for a single job
type JobUpdateRequestBody ¶
type JobUpdateRequestBody struct {
ProjectID int64 `json:"projectId,omitempty"`
ExecutorID *int64 `json:"executorId,omitempty"`
Data string `json:"data,omitempty"`
Spec string `json:"spec,omitempty"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
Timezone string `json:"timezone,omitempty"`
TimezoneOffset int64 `json:"timezoneOffset,omitempty"`
RetryMax int `json:"retryMax,omitempty"`
Status string `json:"status,omitempty"`
}
JobUpdateRequestBody represents the request body for updating a job
type PaginatedCredentialsResponse ¶
type PaginatedCredentialsResponse struct {
Success bool `json:"success"`
Data struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Credentials []Credential `json:"credentials"`
} `json:"data"`
}
type PaginatedExecutionsResponse ¶
type PaginatedExecutionsResponse struct {
Success bool `json:"success"`
Data struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Executions []Execution `json:"executions"`
} `json:"data"`
}
PaginatedExecutionsResponse represents a paginated list of executions
type PaginatedExecutorsResponse ¶
type PaginatedExecutorsResponse struct {
Success bool `json:"success"`
Data struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Executors []Executor `json:"executors"`
} `json:"data"`
}
PaginatedExecutorsResponse represents a paginated list of executors
type PaginatedJobsResponse ¶
type PaginatedJobsResponse struct {
Success bool `json:"success"`
Data struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Jobs []Job `json:"jobs"`
} `json:"data"`
}
PaginatedJobsResponse represents a paginated list of jobs
type PaginatedProjectsResponse ¶
type PaginatedProjectsResponse struct {
Success bool `json:"success"`
Data struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Projects []Project `json:"projects"`
} `json:"data"`
}
PaginatedProjectsResponse represents a paginated list of projects
type Project ¶
type Project struct {
ID string `json:"id"`
AccountID string `json:"accountId"`
Name string `json:"name"`
Description string `json:"description"`
DateCreated string `json:"date_created"`
}
Project represents a project
type ProjectRequestBody ¶
type ProjectRequestBody struct {
Name string `json:"name"`
Description string `json:"description"`
}
ProjectRequestBody represents the request body for creating a project
type ProjectResponse ¶
ProjectResponse represents the response for a single project
type ProjectUpdateRequestBody ¶
type ProjectUpdateRequestBody struct {
Description string `json:"description"`
}
ProjectUpdateRequestBody represents the request body for updating a project
type RaftStats ¶
type RaftStats struct {
AppliedIndex string `json:"applied_index"`
CommitIndex string `json:"commit_index"`
FSMPending string `json:"fsm_pending"`
LastContact string `json:"last_contact"`
LastLogIndex string `json:"last_log_index"`
LastLogTerm string `json:"last_log_term"`
LastSnapshotIndex string `json:"last_snapshot_index"`
LastSnapshotTerm string `json:"last_snapshot_term"`
LatestConfiguration string `json:"latest_configuration"`
LatestConfigIndex string `json:"latest_configuration_index"`
NumPeers string `json:"num_peers"`
ProtocolVersion string `json:"protocol_version"`
ProtocolVersionMax string `json:"protocol_version_max"`
ProtocolVersionMin string `json:"protocol_version_min"`
SnapshotVersionMax string `json:"snapshot_version_max"`
SnapshotVersionMin string `json:"snapshot_version_min"`
State string `json:"state"`
Term string `json:"term"`
}
RaftStats represents the Raft cluster statistics