@datafire/circleci v6.0.0
@datafire/circleci
Client library for CircleCI REST API
Installation and Usage
npm install --save @datafire/circleci
let circleci = require('@datafire/circleci').create({
apikey: ""
});
.then(data => {
console.log(data);
});
Description
The CircleCI API is a RESTful, fully-featured API that allows you to do almost anything in CircleCI. You can access all information and trigger all actions. The only thing we don’t provide access to is billing functions, which must be done from the CircleCI web UI.
Actions
me.get
Provides information about the signed in user.
circleci.me.get(null, context)
Input
This action has no parameters
Output
- output User
project.username.project.get
Build summary for each of the last 30 builds for a single git repo.
circleci.project.username.project.get({
"username": "",
"project": ""
}, context)
Input
- input
object
- limit
integer
: The number of builds to return. Maximum 100, defaults to 30. - offset
integer
: The API returns builds starting from this offset, defaults to 0. - filter
string
(values: completed, successful, failed, running): Restricts which builds are returned. - username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX
- limit
Output
- output Builds
project.username.project.post
Triggers a new build, returns a summary of the build.
circleci.project.username.project.post({
"username": "",
"project": ""
}, context)
Input
- input
object
- body
object
- build_parameters BuildParameters
- parallel Parallel
- revision Revision
- tag Tag
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX
- body
Output
- output BuildSummary
project.username.project.build_cache.delete
Clears the cache for a project.
circleci.project.username.project.build_cache.delete({
"username": "",
"project": ""
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX
- username required
Output
- output
object
- status
string
- status
project.username.project.checkout_key.get
Lists checkout keys.
circleci.project.username.project.checkout_key.get({
"username": "",
"project": ""
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX
- username required
Output
- output Keys
project.username.project.checkout_key.post
Creates a new checkout key. Only usable with a user API token.
circleci.project.username.project.checkout_key.post({
"username": "",
"project": ""
}, context)
Input
- input
object
- body
string
(values: deploy-key, github-user-key) - username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX
- body
Output
- output Key
project.username.project.checkout_key.fingerprint.delete
Delete a checkout key.
circleci.project.username.project.checkout_key.fingerprint.delete({
"username": "",
"project": "",
"fingerprint": ""
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - fingerprint required
string
: XXXXXXXXXX
- username required
Output
- output
object
- message
string
(values: OK)
- message
project.username.project.checkout_key.fingerprint.get
Get a checkout key.
circleci.project.username.project.checkout_key.fingerprint.get({
"username": "",
"project": "",
"fingerprint": ""
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - fingerprint required
string
: XXXXXXXXXX
- username required
Output
- output Key
project.username.project.envvar.get
Lists the environment variables for :project
circleci.project.username.project.envvar.get({
"username": "",
"project": ""
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX
- username required
Output
- output Envvars
project.username.project.envvar.post
Creates a new environment variable
circleci.project.username.project.envvar.post({
"username": "",
"project": ""
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX
- username required
Output
- output Envvar
project.username.project.envvar.name.delete
Deletes the environment variable named ':name'
circleci.project.username.project.envvar.name.delete({
"username": "",
"project": "",
"name": ""
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - name required
string
: XXXXXXXXXX
- username required
Output
- output
object
- message
string
(values: OK)
- message
project.username.project.envvar.name.get
Gets the hidden value of environment variable :name
circleci.project.username.project.envvar.name.get({
"username": "",
"project": "",
"name": ""
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - name required
string
: XXXXXXXXXX
- username required
Output
- output Envvar
project.username.project.ssh_key.post
Create an ssh key used to access external systems that require SSH key-based authentication
circleci.project.username.project.ssh_key.post({
"Content-Type": "",
"body": {},
"username": "",
"project": ""
}, context)
Input
- input
object
- Content-Type required
string
(values: application/json) - body required
object
- hostname
string
- private_key
string
- hostname
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX
- Content-Type required
Output
- output
object
- message
string
- message
project.username.project.tree.branch.post
Triggers a new build, returns a summary of the build. Optional build parameters can be set using an experimental API.
Note: For more about build parameters, read about using parameterized builds
circleci.project.username.project.tree.branch.post({
"username": "",
"project": "",
"branch": ""
}, context)
Input
- input
object
- body
object
- build_parameters BuildParameters
- parallel Parallel
- revision Revision
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - branch required
string
: The branch name should be url-encoded.
- body
Output
- output Build
project.username.project.build_num.get
Full details for a single build. The response includes all of the fields from the build summary. This is also the payload for the notification webhooks, in which case this object is the value to a key named 'payload'.
circleci.project.username.project.build_num.get({
"username": "",
"project": "",
"build_num": 0
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - build_num required
integer
: XXXXXXXXXX
- username required
Output
- output BuildDetail
project.username.project.build_num.artifacts.get
List the artifacts produced by a given build.
circleci.project.username.project.build_num.artifacts.get({
"username": "",
"project": "",
"build_num": 0
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - build_num required
integer
: XXXXXXXXXX
- username required
Output
- output Artifacts
project.username.project.build_num.cancel.post
Cancels the build, returns a summary of the build.
circleci.project.username.project.build_num.cancel.post({
"username": "",
"project": "",
"build_num": 0
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - build_num required
integer
: XXXXXXXXXX
- username required
Output
- output Build
project.username.project.build_num.retry.post
Retries the build, returns a summary of the new build.
circleci.project.username.project.build_num.retry.post({
"username": "",
"project": "",
"build_num": 0
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - build_num required
integer
: XXXXXXXXXX
- username required
Output
- output Build
project.username.project.build_num.tests.get
Provides test metadata for a build Note: Learn how to set up your builds to collect test metadata
circleci.project.username.project.build_num.tests.get({
"username": "",
"project": "",
"build_num": 0
}, context)
Input
- input
object
- username required
string
: XXXXXXXXX - project required
string
: XXXXXXXXX - build_num required
integer
: XXXXXXXXXX
- username required
Output
- output Tests
projects.get
List of all the projects you're following on CircleCI, with build information organized by branch.
circleci.projects.get(null, context)
Input
This action has no parameters
Output
- output Projects
recent_builds.get
Build summary for each of the last 30 recent builds, ordered by build_num.
circleci.recent_builds.get({}, context)
Input
- input
object
- limit
integer
: The number of builds to return. Maximum 100, defaults to 30. - offset
integer
: The API returns builds starting from this offset, defaults to 0.
- limit
Output
- output Builds
user.heroku_key.post
Adds your Heroku API key to CircleCI, takes apikey as form param name.
circleci.user.heroku_key.post(null, context)
Input
This action has no parameters
Output
- output
object
- message
string
- message
Definitions
Artifact
- Artifact
object
- node_index
integer
- path
string
- pretty_path
string
- url
string
- node_index
Artifacts
- Artifacts
array
- items Artifact
Aws
- Aws
object
- keypair
string
- keypair
Build
- Build
object
- body
string
: commit message body - branch
string
- build_time_millis
integer
- build_url
string
- committer_email
string
- committer_name
string
- dont_build
string
: reason why we didn't build, if we didn't build - lifecycle Lifecycle
- previous PreviousBuild
- queued_at
string
: time build was queued - reponame
string
- retry_of
integer
: build_num of the build this is a retry of - start_time
string
: time build started - stop_time
string
: time build finished - subject
string
- username
string
- vcs_url
string
- why
string
: short string explaining the reason we built
- body
BuildDetail
- BuildDetail
object
: previous build- all_commit_details CommitDetails
- compare
string
- job_name
string
- previous_successful_build PreviousBuild
- retries
boolean
- ssh_enabled
boolean
- timedout
boolean
- usage_queued_at
string
- user User
BuildParameters
- BuildParameters
object
: Additional environment variables to inject into the build environment. A map of names to values.
BuildSummary
- BuildSummary
object
Builds
- Builds
array
- items Build
CommitDetail
- CommitDetail
object
- author_date
string
- author_email
string
- author_login
string
- author_name
string
- body
string
- commit Sha1
- commit_url
string
- committer_date
string
- committer_email
string
- committer_login
string
- committer_name
string
- subject
string
- author_date
CommitDetails
- CommitDetails
array
- items CommitDetail
Envvar
- Envvar
object
- name
string
- value
string
- name
Envvars
- Envvars
array
- items Envvar
Key
- Key
object
- fingerprint
string
- preferred
boolean
- public_key
string
- time
string
: when the key was issued - type
string
(values: deploy-key, github-user-key): can be "deploy-key" or "github-user-key"
- fingerprint
Keys
- Keys
array
- items Key
Lifecycle
- Lifecycle
string
(values: queued, scheduled, not_run, not_running, running, finished)
Outcome
- Outcome
string
(values: canceled, infrastructure_fail, timedout, failed, no_tests, success)
Parallel
- Parallel
string
: The number of containers to use to run the build. Default is null and the project default is used.
PreviousBuild
- PreviousBuild
object
: previous build- build_num
integer
- build_time_millis
integer
- status Status
- build_num
Project
- Project
object
- aws Aws
- branches
object
- campfire_notify_prefs StringOrNull
- campfire_room StringOrNull
- campfire_subdomain StringOrNull
- campfire_token StringOrNull
- compile
string
- default_branch
string
- dependencies
string
- extra
string
- feature_flags
object
- build-fork-prs
boolean
- fleet
boolean
- junit
boolean
- oss
boolean
- osx
boolean
- set-github-status
boolean
- trusty-beta
boolean
- build-fork-prs
- flowdock_api_token StringOrNull
- followed
boolean
- has_usable_key
boolean
- heroku_deploy_user StringOrNull
- hipchat_api_token StringOrNull
- hipchat_notify StringOrNull
- hipchat_notify_prefs
string
- hipchat_room StringOrNull
- irc_channel StringOrNull
- irc_keyword StringOrNull
- irc_notify_prefs StringOrNull
- irc_password StringOrNull
- irc_server StringOrNull
- irc_username StringOrNull
- language
string
- oss
boolean
- parallel
integer
- reponame
string
- scopes
array
- items Scope
- setup
string
- slack_api_token StringOrNull
- slack_channel StringOrNull
- slack_channel_override StringOrNull
- slack_notify_prefs StringOrNull
- slack_subdomain StringOrNull
- slack_webhook_url
string
- ssh_keys
array
- items
string
- items
- test
string
- username
string
- vcs_type
string
- vcs_url
string
Projects
- Projects
array
- items Project
Revision
- Revision
string
: The specific revision to build.
Scope
- Scope
string
(values: write-settings, view-builds, read-settings, trigger-builds, all, status, none)
Sha1
- Sha1
string
Status
- Status
string
(values: retried, canceled, infrastructure_fail, timedout, not_run, running, failed, queued, scheduled, not_running, no_tests, fixed, success)
StringOrNull
- StringOrNull
string
Tag
- Tag
string
: The tag to build. Default is null. Cannot be used with revision parameter.
Tests
- Tests
object
- tests
array
- items
object
- classname
string
- file
string
- message
string
- name
string
- result Status
- run_time
number
- source
string
- classname
- items
- tests
User
- User
object
- admin
boolean
- all_emails
array
- items
string
- items
- analytics_id
string
- avatar_url
string
- basic_email_prefs
string
- bitbucket
integer
- bitbucket_authorized
boolean
- containers
integer
- created_at
string
- days_left_in_trial
integer
- dev_admin
boolean
- enrolled_betas
array
- items
string
- items
- github_id
integer
- github_oauth_scopes
array
- items
string
- items
- gravatar_id
integer
- heroku_api_key
string
- in_beta_program
boolean
- login
string
- name
string
- organization_prefs
object
- parallelism
integer
- plan
string
- projects
object
- pusher_id
string
- selected_email
string
- sign_in_count
integer
- trial_end
string
- admin