CircleciOpenapi - the Ruby gem for the CircleCI API
This describes the resources that make up the CircleCI API v2.
This SDK is automatically generated by the OpenAPI Generator project:
- API version: v2
- Package version: 3.0.0
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
To build the Ruby code into a gem:
gem build circleci_openapi.gemspec
Then either install the gem locally:
gem install ./circleci_openapi-3.0.0.gem
(for development, run gem install --dev ./circleci_openapi-3.0.0.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'circleci_openapi', '~> 3.0.0'
If the Ruby gem is hosted at a git repository: https://github.com/rfauglas/GIT_REPO_ID, then add the following in the Gemfile:
gem 'circleci_openapi', :git => 'https://github.com/rfauglas/GIT_REPO_ID.git'
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'circleci_openapi'
# Setup authorization
CircleciOpenapi.configure do |config|
# Configure API key authorization: api_key_header
config.api_key['api_key_header'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['api_key_header'] = 'Bearer'
# Configure API key authorization: api_key_query
config.api_key['api_key_query'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['api_key_query'] = 'Bearer'
# Configure HTTP basic authorization: basic_auth
config.username = 'YOUR_USERNAME'
config.password = 'YOUR_PASSWORD'
end
api_instance = CircleciOpenapi::ContextApi.new
context_id = TODO # String | ID of the context (UUID)
env_var_name = 'POSTGRES_USER' # String | The name of the environment variable
opts = {
inline_object1: CircleciOpenapi::InlineObject1.new({value: 'some-secret-value'}) # InlineObject1 |
}
begin
#Add or update an environment variable
result = api_instance.add_environment_variable_to_context(context_id, env_var_name, opts)
p result
rescue CircleciOpenapi::ApiError => e
puts "Exception when calling ContextApi->add_environment_variable_to_context: #{e}"
end
All URIs are relative to https://circleci.com/api/v2
Class | Method | HTTP request | Description |
---|---|---|---|
CircleciOpenapi::ContextApi | add_environment_variable_to_context | PUT /context/{context-id}/environment-variable/{env-var-name} | Add or update an environment variable |
CircleciOpenapi::ContextApi | create_context | POST /context | Create a new context |
CircleciOpenapi::ContextApi | delete_context | DELETE /context/{context-id} | Delete a context |
CircleciOpenapi::ContextApi | delete_environment_variable_from_context | DELETE /context/{context-id}/environment-variable/{env-var-name} | Remove an environment variable |
CircleciOpenapi::ContextApi | get_context | GET /context/{context-id} | Get a context |
CircleciOpenapi::ContextApi | list_contexts | GET /context | List contexts |
CircleciOpenapi::ContextApi | list_environment_variables_from_context | GET /context/{context-id}/environment-variable | List environment variables |
CircleciOpenapi::InsightsApi | get_project_job_runs | GET /insights/{project-slug}/workflows/{workflow-name}/jobs/{job-name} | Get recent runs of a workflow job |
CircleciOpenapi::InsightsApi | get_project_workflow_job_metrics | GET /insights/{project-slug}/workflows/{workflow-name}/jobs | Get summary metrics for a project workflow's jobs. |
CircleciOpenapi::InsightsApi | get_project_workflow_metrics | GET /insights/{project-slug}/workflows | Get summary metrics for a project's workflows |
CircleciOpenapi::InsightsApi | get_project_workflow_runs | GET /insights/{project-slug}/workflows/{workflow-name} | Get recent runs of a workflow |
CircleciOpenapi::JobApi | cancel_job | POST /project/{project-slug}/job/{job-number}/cancel | Cancel job |
CircleciOpenapi::JobApi | get_job_artifacts | GET /project/{project-slug}/{job-number}/artifacts | Get a job's artifacts |
CircleciOpenapi::JobApi | get_job_details | GET /project/{project-slug}/job/{job-number} | Get job details |
CircleciOpenapi::JobApi | get_tests | GET /project/{project-slug}/{job-number}/tests | Get test metadata |
CircleciOpenapi::PipelineApi | continue_pipeline | POST /pipeline/continue | Continue a pipeline (Preview) |
CircleciOpenapi::PipelineApi | get_pipeline_by_id | GET /pipeline/{pipeline-id} | Get a pipeline |
CircleciOpenapi::PipelineApi | get_pipeline_by_number | GET /project/{project-slug}/pipeline/{pipeline-number} | Get a pipeline |
CircleciOpenapi::PipelineApi | get_pipeline_config_by_id | GET /pipeline/{pipeline-id}/config | Get a pipeline's configuration |
CircleciOpenapi::PipelineApi | list_my_pipelines | GET /project/{project-slug}/pipeline/mine | Get your pipelines |
CircleciOpenapi::PipelineApi | list_pipelines | GET /pipeline | Get a list of pipelines |
CircleciOpenapi::PipelineApi | list_pipelines_for_project | GET /project/{project-slug}/pipeline | Get all pipelines |
CircleciOpenapi::PipelineApi | list_workflows_by_pipeline_id | GET /pipeline/{pipeline-id}/workflow | Get a pipeline's workflows |
CircleciOpenapi::PipelineApi | trigger_pipeline | POST /project/{project-slug}/pipeline | Trigger a new pipeline |
CircleciOpenapi::ProjectApi | create_checkout_key | POST /project/{project-slug}/checkout-key | Create a new checkout key |
CircleciOpenapi::ProjectApi | create_env_var | POST /project/{project-slug}/envvar | Create an environment variable |
CircleciOpenapi::ProjectApi | delete_checkout_key | DELETE /project/{project-slug}/checkout-key/{fingerprint} | Delete a checkout key |
CircleciOpenapi::ProjectApi | delete_env_var | DELETE /project/{project-slug}/envvar/{name} | Delete an environment variable |
CircleciOpenapi::ProjectApi | get_checkout_key | GET /project/{project-slug}/checkout-key/{fingerprint} | Get a checkout key |
CircleciOpenapi::ProjectApi | get_env_var | GET /project/{project-slug}/envvar/{name} | Get a masked environment variable |
CircleciOpenapi::ProjectApi | get_project_by_slug | GET /project/{project-slug} | Get a project |
CircleciOpenapi::ProjectApi | list_checkout_keys | GET /project/{project-slug}/checkout-key | Get all checkout keys |
CircleciOpenapi::ProjectApi | list_env_vars | GET /project/{project-slug}/envvar | List all environment variables |
CircleciOpenapi::UserApi | get_collaborations | GET /me/collaborations | Collaborations |
CircleciOpenapi::UserApi | get_current_user | GET /me | User Information |
CircleciOpenapi::UserApi | get_user | GET /user/{id} | User Information |
CircleciOpenapi::WorkflowApi | approve_pending_approval_job_by_id | POST /workflow/{id}/approve/{approval_request_id} | Approve a job |
CircleciOpenapi::WorkflowApi | cancel_workflow | POST /workflow/{id}/cancel | Cancel a workflow |
CircleciOpenapi::WorkflowApi | get_workflow_by_id | GET /workflow/{id} | Get a workflow |
CircleciOpenapi::WorkflowApi | list_workflow_jobs | GET /workflow/{id}/job | Get a workflow's jobs |
CircleciOpenapi::WorkflowApi | rerun_workflow | POST /workflow/{id}/rerun | Rerun a workflow |
- CircleciOpenapi::Artifact
- CircleciOpenapi::ArtifactListResponse
- CircleciOpenapi::CheckoutKey
- CircleciOpenapi::CheckoutKeyInput
- CircleciOpenapi::CheckoutKeyListResponse
- CircleciOpenapi::Collaboration
- CircleciOpenapi::Context
- CircleciOpenapi::EnvironmentVariableListResponse
- CircleciOpenapi::EnvironmentVariablePair
- CircleciOpenapi::EnvironmentVariablePair1
- CircleciOpenapi::InlineObject
- CircleciOpenapi::InlineObject1
- CircleciOpenapi::InlineObject2
- CircleciOpenapi::InlineResponse200
- CircleciOpenapi::InlineResponse2001
- CircleciOpenapi::InlineResponse2001Items
- CircleciOpenapi::InlineResponse2002
- CircleciOpenapi::InlineResponse2002Items
- CircleciOpenapi::InlineResponse2002Metrics
- CircleciOpenapi::InlineResponse2002MetricsDurationMetrics
- CircleciOpenapi::InlineResponse2003
- CircleciOpenapi::InlineResponse2003Items
- CircleciOpenapi::InlineResponse2004
- CircleciOpenapi::InlineResponse2004Items
- CircleciOpenapi::InlineResponse2004Metrics
- CircleciOpenapi::InlineResponse2004MetricsDurationMetrics
- CircleciOpenapi::InlineResponse2005
- CircleciOpenapi::InlineResponse2005Items
- CircleciOpenapi::InlineResponseDefault
- CircleciOpenapi::Job
- CircleciOpenapi::JobDetails
- CircleciOpenapi::JobDetailsContexts
- CircleciOpenapi::JobDetailsExecutor
- CircleciOpenapi::JobDetailsLatestWorkflow
- CircleciOpenapi::JobDetailsMessages
- CircleciOpenapi::JobDetailsOrganization
- CircleciOpenapi::JobDetailsParallelRuns
- CircleciOpenapi::JobDetailsPipeline
- CircleciOpenapi::JobDetailsProject
- CircleciOpenapi::MessageResponse
- CircleciOpenapi::Pipeline
- CircleciOpenapi::PipelineConfig
- CircleciOpenapi::PipelineCreation
- CircleciOpenapi::PipelineListResponse
- CircleciOpenapi::PipelineListResponseErrors
- CircleciOpenapi::PipelineListResponseTrigger
- CircleciOpenapi::PipelineListResponseTriggerActor
- CircleciOpenapi::PipelineListResponseVcs
- CircleciOpenapi::PipelineListResponseVcsCommit
- CircleciOpenapi::Project
- CircleciOpenapi::ProjectVcsInfo
- CircleciOpenapi::RerunWorkflowParameters
- CircleciOpenapi::TestsResponse
- CircleciOpenapi::TestsResponseItems
- CircleciOpenapi::TriggerPipelineParameters
- CircleciOpenapi::User
- CircleciOpenapi::Workflow
- CircleciOpenapi::WorkflowJobListResponse
- CircleciOpenapi::WorkflowListResponse
- Type: API key
- API key parameter name: Circle-Token
- Location: HTTP header
- Type: API key
- API key parameter name: circle-token
- Location: URL query string
- Type: HTTP basic authentication