The CircleCI API Go SDK is a Golang package for accessing the resources that make up the CircleCI API V2.
go get github.com/swissknife/circle-gopackage main
import (
"github.com/swissknife/circle-go"
"github.com/swissknife/circle-go/pkg/models/shared"
"github.com/swissknife/circle-go/pkg/models/operations"
)
func main() {
opts := []sdk.SDKOption{
sdk.WithSecurity(
shared.Security{
APIKeyHeader: &shared.SchemeAPIKeyHeader{
APIKey: "YOUR_API_KEY_HERE",
},
}
),
}
s := sdk.New(opts...)
req := operations.AddEnvironmentVariableToContextRequest{
PathParams: operations.AddEnvironmentVariableToContextPathParams{
ContextID: "sit",
EnvVarName: "voluptas",
},
Request: &operations.AddEnvironmentVariableToContextRequestBody{
Value: "culpa",
},
}
res, err := s.Context.AddEnvironmentVariableToContext(ctx, req)
if err != nil {
log.Fatal(err)
}
if res.AddEnvironmentVariableToContext200ApplicationJSONAnyOf != nil {
// handle response
}AddEnvironmentVariableToContext- Add or update an environment variableCreateContext- Create a new contextDeleteContext- Delete a contextDeleteEnvironmentVariableFromContext- Remove an environment variableGetContext- Get a contextListContexts- List contextsListEnvironmentVariablesFromContext- List environment variables
GetAllInsightsBranches- Get all branches for a projectGetFlakyTests- Get flaky tests for a projectGetJobTimeseries- Job timeseries dataGetOrgSummaryData- Get summary metrics with trends for the entire org, and for each project.GetProjectWorkflowJobMetrics- Get summary metrics for a project workflow's jobs.GetProjectWorkflowMetrics- Get summary metrics for a project's workflowsGetProjectWorkflowRuns- Get recent runs of a workflowGetProjectWorkflowTestMetrics- Get test metrics for a project's workflowsGetProjectWorkflowsPageData- Get summary metrics and trends for a project across it's workflows and branchesGetWorkflowSummary- Get metrics and trends for workflows
CancelJob- Cancel jobGetJobArtifacts- Get a job's artifactsGetJobDetails- Get job detailsGetTests- Get test metadata
ContinuePipeline- Continue a pipelineGetPipelineByID- Get a pipeline by IDGetPipelineByNumber- Get a pipeline by pipeline numberGetPipelineConfigByID- Get a pipeline's configurationListMyPipelines- Get your pipelinesListPipelines- Get a list of pipelinesListPipelinesForProject- Get all pipelinesListWorkflowsByPipelineID- Get a pipeline's workflowsTriggerPipeline- Trigger a new pipeline
CreateCheckoutKey- Create a new checkout keyCreateEnvVar- Create an environment variableDeleteCheckoutKey- Delete a checkout keyDeleteEnvVar- Delete an environment variableGetCheckoutKey- Get a checkout keyGetEnvVar- Get a masked environment variableGetProjectBySlug- Get a projectListCheckoutKeys- Get all checkout keysListEnvVars- List all environment variables
CreateSchedule- Create a scheduleDeleteScheduleByID- Delete a scheduleGetScheduleByID- Get a scheduleListSchedulesForProject- Get all schedulesUpdateSchedule- Update a schedule
GetCollaborations- CollaborationsGetCurrentUser- User InformationGetUser- User Information
CreateWebhook- Create a webhookDeleteWebhook- Delete a webhookGetWebhookByID- Get a webhookGetWebhooks- List webhooksUpdateWebhook- Update a webhook
ApprovePendingApprovalJobByID- Approve a jobCancelWorkflow- Cancel a workflowGetWorkflowByID- Get a workflowListWorkflowJobs- Get a workflow's jobsRerunWorkflow- Rerun a workflow