From 5d3e2cc5f37101d301b7d24c34c55ab764f61946 Mon Sep 17 00:00:00 2001 From: Maciej Skierkowski Date: Tue, 25 Nov 2014 23:13:24 -0800 Subject: [PATCH] fixing a few formatting issues per #14 --- source/connectors/bitballoon.md | 7 +- source/connectors/chef.md | 5 +- source/connectors/github.md | 210 ++++++++++++------- source/connectors/heroku.md | 8 +- source/connectors/hipchat.md | 86 ++++---- source/connectors/jenkins.md | 18 +- source/connectors/newrelic.md | 2 +- source/connectors/pagerduty.md | 8 +- source/connectors/pushover.md | 34 +-- source/connectors/rackspace.md | 29 ++- source/connectors/web.md | 7 +- source/learn/step_2_your_first_command.md | 1 + source/learn/step_3_your_first_workflow.md | 4 +- source/learn/step_4_getting_more_services.md | 1 - 14 files changed, 252 insertions(+), 168 deletions(-) diff --git a/source/connectors/bitballoon.md b/source/connectors/bitballoon.md index 90e8310..f3dceb6 100644 --- a/source/connectors/bitballoon.md +++ b/source/connectors/bitballoon.md @@ -19,9 +19,10 @@ The deploy action (`bitballoon::deploy`) provides the means of uploading your fu ## Parameters -- **site** (required): This is the GUID of your site. When you deploy your application from the command line, the BitBalloon CLI will generate a .bitballoon file in that directory. You can find the site ID in that file. -- **content** (requried): This is a reference to the files to be uploaded. Other actions like github::push, github::download, ssh::download will generate a reference to these files. - +ID | Default | Description +--- | --- | --- +site | | This is the GUID of your site. When you deploy your application from the command line, the BitBalloon CLI will generate a .bitballoon file in that directory. You can find the site ID in that file. +content | | This is a reference to the files to be uploaded. Other actions like github::push, github::download, ssh::download will generate a reference to these files. ## Example This example will wait for a git push in github, then upload it, build it, and download it from an SSH server. Once complete, it diff --git a/source/connectors/chef.md b/source/connectors/chef.md index 881dc11..eb5eade 100644 --- a/source/connectors/chef.md +++ b/source/connectors/chef.md @@ -6,7 +6,7 @@ This Chef Connector enables you to bootstrap a server using both Chef Server and # Authentication ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- private_key | false | The Private Key chef needs to SSH into the remote server validation_key | false | The validation key provided by Chef Server. Typically found in `~/.chef`. organization | false | The organization name as managed in Chef Server. @@ -17,6 +17,7 @@ chef_server | https://api.opscode.com/organizations/{organization} | The Chef Se Below is an example credentials.yml file with the above values. **credential.yml** + ```yaml --- chef: @@ -53,7 +54,7 @@ chef: ## Input parameters ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- host | false | The host address for the server to bootstrap, including the username (e.g. `ubuntu@10.03.221.02`) runlist | false | The Chef runlist for bootstrapping. e.g. `role[console]` name | false | The name of the server as it will be captured on the chef server diff --git a/source/connectors/github.md b/source/connectors/github.md index 3d5b41f..662fa78 100644 --- a/source/connectors/github.md +++ b/source/connectors/github.md @@ -13,187 +13,237 @@ Github requires an API Key (api_key) to be defined in your credentials.yml file. # Parameters All of the listeners below require the same set of parameters -- **repo**: The address of the repo in the format (user/repo#branch). The use rand repo in the format are required while the branch is optional. If the branch is not specified it will default to `master`. For example `skierkowski/hello` would refer to https://github.com/skierkowski/hello and `skierkowski/hello#new-feature-3` references the new-feature-3 branch. +ID | Default | Description +--- | --- | --- +repo | | The address of the repo in the format (user/repo#branch). The use rand repo in the format are required while the branch is optional. If the branch is not specified it will default to `master`. For example `skierkowski/hello` would refer to https://github.com/skierkowski/hello and `skierkowski/hello#new-feature-3` references the new-feature-3 branch. # github::commit_comment The Commit Comment Listener (`github::commit_comment`) is triggered when a commit comment is created. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#commitcommentevent). ## Example - listen 'github::commit_comment', repo:'skierkowski/hello' do |comment| - info "#{comment.user.login} just commented '#{comment.body}' on #{comment.repository.full_name}" - end + +```ruby +listen 'github::commit_comment', repo:'skierkowski/hello' do |comment| + info "#{comment.user.login} just commented '#{comment.body}' on #{comment.repository.full_name}" +end +``` # github::create The Create Listener (`github::create`) listeners for the creation of new branches, or tags. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#createevent). ## Example - listen 'github::create', repo:'skierkowski/hello' do |create_event| - if create_event.ref_type == 'tag' - info "#{create_event.sender.login} just created a new tag called #{create_event.ref}" - elsif create_event.ref_type == 'branch' - info "#{create_event.sender.login} just created a new branch called #{create_event.ref}" - end - end + +```ruby +listen 'github::create', repo:'skierkowski/hello' do |create_event| + if create_event.ref_type == 'tag' + info "#{create_event.sender.login} just created a new tag called #{create_event.ref}" + elsif create_event.ref_type == 'branch' + info "#{create_event.sender.login} just created a new branch called #{create_event.ref}" + end +end +``` # github::delete The Delete Listener (`github::delete`) listeners for the deleting of new branches, or tags. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#deleteevent). ## Example - listen 'github::delete', repo:'skierkowski/hello' do |delete_event| - if delete_event.ref_type == 'tag' - info "#{delete_event.sender.login} just deleted a new tag called #{delete_event.ref}" - elsif delete_event.ref_type == 'branch' - info "#{delete_event.sender.login} just deleted a new branch called #{delete_event.ref}" - end - end + +```ruby +listen 'github::delete', repo:'skierkowski/hello' do |delete_event| + if delete_event.ref_type == 'tag' + info "#{delete_event.sender.login} just deleted a new tag called #{delete_event.ref}" + elsif delete_event.ref_type == 'branch' + info "#{delete_event.sender.login} just deleted a new branch called #{delete_event.ref}" + end +end +``` # github::deployment The Deployment Listener (`github::deployment`) is triggered on new deployments. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#deployevent). ## Example - listen 'github::deployment', repo:'skierkowski/hello' do |deploy| - info "The #{deploy.name}/#{deploy.ref} is getting deployed to the #{deploy.environment} environment." - end + +```ruby +listen 'github::deployment', repo:'skierkowski/hello' do |deploy| + info "The #{deploy.name}/#{deploy.ref} is getting deployed to the #{deploy.environment} environment." +end +``` # github::deployment_status The Deployment Status Listener (`github::deployment_status`) is triggered when the status of a deployment changes. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#deploymentstatusevent). ## Example - listen 'github::deployment_status', repo:'skierkowski/hello' do |deploy| - info "The #{deploy.name}/#{deploy.ref} deployment status changed to #{deploy.status} for the deployment to the #{deploy.deployment.environment} environment" - end + +```ruby +listen 'github::deployment_status', repo:'skierkowski/hello' do |deploy| + info "The #{deploy.name}/#{deploy.ref} deployment status changed to #{deploy.status} for the deployment to the #{deploy.deployment.environment} environment" +end +``` # github::download The Download Listener (`github::download`) is triggered when a download is created. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#downloadevent). ## Example - listen 'github::download', repo:'skierkowski/hello' - success "A new download was created" - end + +```ruby +listen 'github::download', repo:'skierkowski/hello' + success "A new download was created" +end +``` # github::fork The Fork Listener (`github::fork`) is triggered when the repo is forked. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#forkevent). ## Example - listen 'github::fork', repo:'skierkowski/hello' do |fork| - info "#{fork.forkee.name} just forked #{fork.repository.full_name}" - end + +```ruby +listen 'github::fork', repo:'skierkowski/hello' do |fork| + info "#{fork.forkee.name} just forked #{fork.repository.full_name}" +end +``` # github::gollum The Gollum Listener (`github::gollum`) is triggered when a Wiki page is created or updated. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#gollumevent). ## Example - listen 'github::gollum', repo:'skierkowski/hello' do |wiki| - info "#{wiki.pages.count} pages have been created or updated in #{wiki.repository.full_name} by #{wiki.sender.login}" - end + +```ruby +listen 'github::gollum', repo:'skierkowski/hello' do |wiki| + info "#{wiki.pages.count} pages have been created or updated in #{wiki.repository.full_name} by #{wiki.sender.login}" +end +``` # github::issue_comment The Issue Comment Listener (`github::issue_comment`) is triggered when an issue comment is created. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#issuecommentevent). ## Example - listen 'github::issue_comment', repo:'skierkowski/hello' do |comment| - info "#{comment.sender.login} #{comment.action} a comment on issue #{comment.issue.title} with `#{comment.comment.body}`" - end +```ruby +listen 'github::issue_comment', repo:'skierkowski/hello' do |comment| + info "#{comment.sender.login} #{comment.action} a comment on issue #{comment.issue.title} with `#{comment.comment.body}`" +end +``` # github::issues The Issues Listener (`github::issues`) is triggered when an issue is assigned, unassigned, labeled, unlabeled, opened, closed, or reoponed. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#issuesevent). ## Example - listen 'github::issues', repo:'skierkowski/hello' do |issue| - info "#{issue.sender.login} #{issue.action} an issue titled #{issue.title}" - end +```ruby +listen 'github::issues', repo:'skierkowski/hello' do |issue| + info "#{issue.sender.login} #{issue.action} an issue titled #{issue.title}" +end +``` # github::member The Member Listener (`github::member`) is triggered when a user is added as a collaborator to a repository. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#memberevent). ## Example - listen 'github::member', repo:'skierkowski/hello' do |issue| - info "#{member.login} was #{action} to the repo #{issue.repository.full_name}" - end +```ruby +listen 'github::member', repo:'skierkowski/hello' do |issue| + info "#{member.login} was #{action} to the repo #{issue.repository.full_name}" +end +``` # github::page_build The Page Build Listener (`github::page_build`) is triggered when an attempt is made to build a Github Page site, whether successful or not. This is triggered on push to a Github Pages enabled branch, either `gh-pages` for project pages, or `master` for user/organization pages. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#pagebuildevent). ## Example - listen 'github::page_build', repo:'skierkowski/hello' do |page| - if page.build.status == 'built' - success "#{page.build.pusher.login} successfully built #{page.repository.full_name}" - else - fail "Failed to build #{page.repository.full_name}" - end - end +```ruby +listen 'github::page_build', repo:'skierkowski/hello' do |page| + if page.build.status == 'built' + success "#{page.build.pusher.login} successfully built #{page.repository.full_name}" + else + fail "Failed to build #{page.repository.full_name}" + end +end +``` # github::public The Public Listener (`github::public`) is triggered when a repo is open sourced. We need more of these. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#publicevent). ## Example - listen 'github::public', repo: 'factor-io/factor' do |repo| - success "Yey, we went open source!" - end +```ruby +listen 'github::public', repo: 'factor-io/factor' do |repo| + success "Yey, we went open source!" +end +``` # github::pull_request The Pull Request Listener (`github::pull_request`) is triggered when a pull request is assigned, unassigned, labeled, unlabeled, opened, closed, reopened, or synchronized. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#pullrequestevent). ## Example - listen 'github::pull_request', repo:'skierkowski/hello' do |request| - msg = "Pull request #{request.number} was #{request.action}: #{request.pull_request.title}" - run 'hipchat::send', room:'Engineering', message: msg - end +```ruby +listen 'github::pull_request', repo:'skierkowski/hello' do |request| + msg = "Pull request #{request.number} was #{request.action}: #{request.pull_request.title}" + run 'hipchat::send', room:'Engineering', message: msg +end +``` # github::pull_request_review_comment The Pull Request Review Comment Listener (`github::pull_request_review_comment`) is triggered when a comment is created on a portion of the unified diff of a pull request. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#pullrequestreviewcommentevent). ## Example - listen 'github::pull_request_review_comment', repo:'skierkowski/hello' do |comment| - info "#{comment.sender.login} #{comment.action} commented #{comment.comment.body} on #{comment.repository.full_name}" - end +```ruby +listen 'github::pull_request_review_comment', repo:'skierkowski/hello' do |comment| + info "#{comment.sender.login} #{comment.action} commented #{comment.comment.body} on #{comment.repository.full_name}" +end +``` # github::push The Push Listener (`github::push`) is triggered when a repository branch is pushed to. This is the most used listener as it is often used to invoke deployments when code is pushed or merged into the master branch. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#pushevent). ## Example - listen 'github::push', repo:'skierkowski/hello#master' do |github_info| - run 'heroku::deploy', app:'hello-frank', content:github_info.content do |deploy_info| - info 'Deployment is complete' - end - end +```ruby +listen 'github::push', repo:'skierkowski/hello#master' do |github_info| + run 'heroku::deploy', app:'hello-frank', content:github_info.content do |deploy_info| + info 'Deployment is complete' + end +end +``` # github::release The Release Listener (`github::release`) is triggered when a release is published. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#releaseevent). ## Example - listen 'github::release', repo:'skierkowski/hello#master' do |release| - info "Release #{release.release.tag_name} was #{release.action}" - end +```ruby +listen 'github::release', repo:'skierkowski/hello#master' do |release| + info "Release #{release.release.tag_name} was #{release.action}" +end +``` # github::status The Status Listener (`github::status`) is triggered when the status of a git commit changes. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#statusevent). ## Example - listen 'github::status', repo:'skierkowski/hello' do |status| - info "Commit #{status.commit.message} was a #{status.state}" - end +```ruby +listen 'github::status', repo:'skierkowski/hello' do |status| + info "Commit #{status.commit.message} was a #{status.state}" +end +``` # github::team_add The Team Add listener (`github::team_add`) is triggered when a user or repository is added to a team. The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#teamaddevent). ## Example - listen 'github::team_add', repo:'skierkowski/hello' do |add_info| - if add_info.team - info "Team #{add_info.team.name} was added to #{add_info.repository.full_name}" - elsif add_info.user - info "Team #{add_info.user.login} was added to #{add_info.repository.full_name}" - end - end +```ruby +listen 'github::team_add', repo:'skierkowski/hello' do |add_info| + if add_info.team + info "Team #{add_info.team.name} was added to #{add_info.repository.full_name}" + elsif add_info.user + info "Team #{add_info.user.login} was added to #{add_info.repository.full_name}" + end +end +``` # github::watch The Watch Listener (`github::watch`) is triggered when a user Stars a repository (not watches). The details of the returned output can be found [here](https://developer.github.com/v3/activity/events/types/#watchevent). ## Example - listen 'github::watch', repo:'skierkowski/hello' do |watch| - info "#{watch.sender.login} #{watch.action} repo #{watch.repository.full_name}" - end +```ruby +listen 'github::watch', repo:'skierkowski/hello' do |watch| + info "#{watch.sender.login} #{watch.action} repo #{watch.repository.full_name}" +end +``` diff --git a/source/connectors/heroku.md b/source/connectors/heroku.md index c4e3df3..be5d9c9 100644 --- a/source/connectors/heroku.md +++ b/source/connectors/heroku.md @@ -16,8 +16,12 @@ heroku: The Deploy Action (`heroku::deploy`) is an action to deploy files to an application in Heroku. ## Parameters -- **app**: The Heroku application ID you are deploying. -- **content**: The reference to the contents that is to be deployed. The contents is retreived from anther listener (e.g. github::push) or action (e.g. github::download) + +ID | Default | Description +--- | --- | --- +app | | The Heroku application ID you are deploying. +content | | The reference to the contents that is to be deployed. The contents is retreived from anther listener (e.g. github::push) or action (e.g. github::download) + ## Output prameters - **release**: Release number used to track in Heroku diff --git a/source/connectors/hipchat.md b/source/connectors/hipchat.md index 2f4ccd1..4a2ba8e 100644 --- a/source/connectors/hipchat.md +++ b/source/connectors/hipchat.md @@ -17,53 +17,61 @@ Hipchat requires a personal API Key. This key can be found under Account Setting The Room Message Listener (`hipchat::message`) listens for when someone posts a new message to a room. The filter parameter filters the messages only for ones that match the regular expression. ## Params -- **room** (required): the name of the room wher eyou want to listen for messages -- **filter** (required): A regular expression filter of the messages you want to get. This also supports matching. + +ID | Default | Description +--- | --- | --- +room | | The name of the room where you want to listen for messages +filter | | A regular expression filter of the messages you want to get. This also supports matching. + ## Example - listen 'hipchat::message', room:'Factor', filter:'ping (.*)' do |message| - run 'hipchat::send', room:'Factor', message: "pong #{message.matches[0]}" - end +```ruby +listen 'hipchat::message', room:'Factor', filter:'ping (.*)' do |message| + run 'hipchat::send', room:'Factor', message: "pong #{message.matches[0]}" +end +``` ## Response example - { - "event" => "room_message", - "oauth_client_id" => "69563cb5-057d-4e9d-a9db-d1bc458170a1", - "webhook_id" => 66824, - "service_id" => "hipchat", - "listener_id" => "room_message", - "instance_id" => "a842597ce18da4b17b52f4bc63d9cf89", - "hook_id" => 66824, - "message" => "go foo", - "matches" => [ - "foo" - ], - "item" => { - "message" => { - "id" => "25b9dfe9-dfc9-487e-b996-2297caaca915", - "mentions" => [], - "message" => "go foo", - "date" => "2014-07-30T18:30:25.236745+00:00", - "from" => { - "id" => 233775, - "mention_name" => "Skierkowski", - "name" => "Maciej Skierkowski", - "links" => { - "self" => "https://api.hipchat.com/v2/user/233775" - } - } - }, - "room" => { - "id" => 142882, - "name" => "Factor", - "links" => { - "self" => "https://api.hipchat.com/v2/room/142882", - "webhooks" => "https://api.hipchat.com/v2/room/142882/webhook" - } +```ruby +{ + "event" => "room_message", + "oauth_client_id" => "69563cb5-057d-4e9d-a9db-d1bc458170a1", + "webhook_id" => 66824, + "service_id" => "hipchat", + "listener_id" => "room_message", + "instance_id" => "a842597ce18da4b17b52f4bc63d9cf89", + "hook_id" => 66824, + "message" => "go foo", + "matches" => [ + "foo" + ], + "item" => { + "message" => { + "id" => "25b9dfe9-dfc9-487e-b996-2297caaca915", + "mentions" => [], + "message" => "go foo", + "date" => "2014-07-30T18:30:25.236745+00:00", + "from" => { + "id" => 233775, + "mention_name" => "Skierkowski", + "name" => "Maciej Skierkowski", + "links" => { + "self" => "https://api.hipchat.com/v2/user/233775" } } + }, + "room" => { + "id" => 142882, + "name" => "Factor", + "links" => { + "self" => "https://api.hipchat.com/v2/room/142882", + "webhooks" => "https://api.hipchat.com/v2/room/142882/webhook" + } } + } +} +``` # hipchat::notification The Room Notification Listener (`hipchat::notification`) listens for when someone sends a notification to the room. Details of returned data can be found [here](https://www.hipchat.com/docs/apiv2/webhooks#room_notification). diff --git a/source/connectors/jenkins.md b/source/connectors/jenkins.md index e102aff..598d0fe 100644 --- a/source/connectors/jenkins.md +++ b/source/connectors/jenkins.md @@ -27,7 +27,7 @@ jenkins: ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- filter | (optional) | Regex for searching through jobs status | (optional) | The job status to filter by @@ -38,11 +38,11 @@ status | (optional) | The job status to filter by ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- job | | The Job ID to build ## Output -```json +```javascript { code: '200' } @@ -53,11 +53,11 @@ job | | The Job ID to build ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- job | | The Job ID to stop ## Output -```json +```javascript { code: '200' } @@ -68,11 +68,11 @@ job | | The Job ID to stop ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- job | | The Job ID to get the status ## Output -```json +```javascript { code: '200' } @@ -82,12 +82,12 @@ job | | The Job ID to get the status ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- job | | The Job ID to rename new_job | | The new Job ID ## Output -```json +```javascript { code: '200' } diff --git a/source/connectors/newrelic.md b/source/connectors/newrelic.md index 96ca754..1a247b1 100644 --- a/source/connectors/newrelic.md +++ b/source/connectors/newrelic.md @@ -15,7 +15,7 @@ The API Key can be found under Account Settings > Data Sharing in the API access ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- server | | The Server ID to get server metrics application | | The Application ID to get the application metrics range | (optional) | A Hash with the values {from:'...', to:'...''} defining the date range for the summary. If not specified gets the current values. diff --git a/source/connectors/pagerduty.md b/source/connectors/pagerduty.md index 82d5bf0..662129b 100644 --- a/source/connectors/pagerduty.md +++ b/source/connectors/pagerduty.md @@ -16,7 +16,7 @@ Your access key can be found in the same way. ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- service_key | | incident_key | | client | | @@ -28,7 +28,7 @@ description | | ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- service_key | | incident_key | | @@ -37,7 +37,7 @@ incident_key | | ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- service_key | | incident_key | | @@ -46,7 +46,7 @@ incident_key | | ## Input ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- service_key | | incident_key | | diff --git a/source/connectors/pushover.md b/source/connectors/pushover.md index 14214d9..56d7a1e 100644 --- a/source/connectors/pushover.md +++ b/source/connectors/pushover.md @@ -17,22 +17,28 @@ You will need the Username (username) and API Key (api_key) from Pushover. The u The Notify Action (`pushover::notify`) sends messages to your Pushover clients. ## Parameters -- **message (required)**: The message to send to your device -- **title (optional)**: (defualt: 'Factor.io'): Optional title of the message +ID | Default | Description +--- | --- | --- +message | | The message to send to your device +title | 'Factor.io' | Optional title of the message ## Response - { - 'status':1, - 'request': '99fc262204305588f222c3445fd82364' - } +```ruby +{ + 'status' => 1, + 'request' => '99fc262204305588f222c3445fd82364' +} +``` ## Example - listen 'github::push', repo:'skierkowski/hello' do |repo_info| - run 'pushover::notify', message: "#{repo_info.repository.full_name} has new code" do |notify_info| - if notify_info.status == 1 - success "Message delivered" - else - fail "Failed to deliver message" - end - end +```ruby +listen 'github::push', repo:'skierkowski/hello' do |repo_info| + run 'pushover::notify', message: "#{repo_info.repository.full_name} has new code" do |notify_info| + if notify_info.status == 1 + success "Message delivered" + else + fail "Failed to deliver message" end + end +end +``` diff --git a/source/connectors/rackspace.md b/source/connectors/rackspace.md index a32c2ec..f92a1ba 100644 --- a/source/connectors/rackspace.md +++ b/source/connectors/rackspace.md @@ -6,7 +6,8 @@ category: Connectors Rackspace requires a username, API Key, and for certain actions an SSH Key. To obtain your Username and API Key go to the **[Cloud Control Panel](https://mycloud.rackspace.com/)** > **Account Settings**. There you will find "Username" and "API Key" information. **credentials.yml** -```yml + +```yaml rackspace: api_key: d3aea086db586db5e981c28bfe852d3ae username: skierkowski @@ -14,7 +15,7 @@ rackspace: For operations like bootstrapping a new server, you will also need to provide public private key pair. -```yml +```yaml --- rackspace: api_key: d3aea086db586db5e981c28bfe852d3ae @@ -62,6 +63,7 @@ web: wss://open-connectors.factor.io/v0.4/web ## Output Output is an Array of Hashes. The Factor Server automatically converts this to a nested OStruct, so you can address variables like `servers.first.addresses.public.last.addr`. + ```ruby [ { @@ -142,6 +144,7 @@ end ## Output Output is a Hash of details for that server. The Factor Server automatically converts this to a nested OStruct, so you can address variables like `server.addresses.public.last.addr`. + ```ruby { :state => "ACTIVE", @@ -203,6 +206,7 @@ Output is a Hash of details for that server. The Factor Server automatically con - **wait** (optional, default: true): By default this will start the creation process and wait until it is completed (or fails). This can take about 10 minutes to complete, but will be ready to use once complete. By setting 'wait' to false, the creation will run asynchronously and the execution will continue without waiting for the results. ## Output + ```ruby { :state => "ACTIVE", @@ -281,6 +285,7 @@ This is the only action which requires the additional SSH public/private key to - **wait** (optional, default: true): By default this will start the creation process and wait until it is completed (or fails). This can take about 10 minutes to complete, but will be ready to use once complete. By setting 'wait' to false, the creation will run asynchronously and the execution will continue without waiting for the results. ## Output + ```ruby { :state => "ACTIVE", @@ -373,6 +378,7 @@ Use this to run SSH commands on server. You can pass a list of commands and all ``` ## Example + ```ruby listen 'github::push', repo:'factor-io/console' do |github_info| run 'rackspace::compute::list', region:'dfw' do |servers| @@ -400,6 +406,7 @@ This will delete a server in a region. This executes asynchronously, so it will ## Output Output is a Hash of details for that server. + ```ruby { :state => "ACTIVE", @@ -469,6 +476,7 @@ Output is a Hash of details for that server. - **region** (optional, default:'ord'): A string containing the three letter region ## Output + ```ruby [ { @@ -533,6 +541,7 @@ Output is a Hash of details for that server. ``` ### Example + ```ruby listen 'hipchat::message', room:'Factor', filter:'rackspace flavors ([a-zA-Z0-1])' do |hipchat| criteria = hipchat.matches[0] @@ -651,7 +660,7 @@ end ## Input ID | default | Description --- | -------- | ----------- +--- | -------- | ----------- region | 'ord' | A string containing the three letter region ## Output @@ -676,7 +685,7 @@ region | 'ord' | A string containing the three letter region ## Input ID | default | Description --- | -------- | ----------- +--- | -------- | ----------- region | 'ord' | A string containing the three letter region id | false | The Load Balancer ID @@ -730,7 +739,7 @@ id | false | The Load Balancer ID ## Input ID | default | Description --- | -------- | ----------- +--- | -------- | ----------- region | 'ord' | A string containing the three letter region id | false | The Load Balancer ID @@ -739,7 +748,7 @@ id | false | The Load Balancer ID ## Input ID | default | Description --- | -------- | ----------- +--- | -------- | ----------- region | 'ord' | A string containing the three letter region id | | The Load Balancer ID name | | Name of the load balancer @@ -753,7 +762,7 @@ wait | false | Should the call wait until the load balancer is created (or faile # rackspace::loadbalancer::add_node ## Input ID | default | Description --- | -------- | ----------- +--- | -------- | ----------- region | 'ord' | A string containing the three letter region id | | The Load Balancer ID address | | The host address, no port, scheme, or path @@ -761,9 +770,11 @@ port | 80 | The TCP/IP Port to use condition | 'ENABLED' | State of the node. Likely want to keep the default here. # rackspace::loadbalancer::remove_node + ## Input + ID | default | Description --- | -------- | ----------- +--- | -------- | ----------- region | 'ord' | A string containing the three letter region load_balancer_id | | The Load Balancer ID id | | Node ID @@ -773,7 +784,7 @@ id | | Node ID ## Input ID | default | Description --- | -------- | ----------- +--- | -------- | ----------- region | 'ord' | A string containing the three letter region id | | The Load Balancer ID diff --git a/source/connectors/web.md b/source/connectors/web.md index 8d8ded7..9ec3823 100644 --- a/source/connectors/web.md +++ b/source/connectors/web.md @@ -10,7 +10,7 @@ The Hook Listener (`web::hook`) generates a one-time web hook as a trigger to yo ## Parameters: ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- id | (random) | An optional parameter to generate a static address. By default the hook address will be generated at random every time this is restarted. By specifying an ID the generate address will be `/v0.4/hooks/` as opposed to `/v0.4/web/listeners/hook//hooks/`. ## Output: @@ -32,7 +32,7 @@ end The Post Action (`web::post`) will make an HTTP POST to the provided address with the parameters and headers provided ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- params | {} | a hash of the variables to POST. This will be JSON serialized and passed as the body in the HTTP POST. headers | {} | a hash of the HTTP Headers to pass. url | false | the HTTP Address to POST to. @@ -57,8 +57,9 @@ end The Get Action (`web::get`) will make an HTTP POST to the provided address with the parameters and headers provided ## Parameters + ID | Default | Description --- | ------- | ----------- +--- | ------- | ----------- params | {} | a hash of the variables to add as query string parameters. headers | {} | a hash of the HTTP Headers to pass. url | false | the HTTP Address to POST to. diff --git a/source/learn/step_2_your_first_command.md b/source/learn/step_2_your_first_command.md index fb7aa24..1e02148 100644 --- a/source/learn/step_2_your_first_command.md +++ b/source/learn/step_2_your_first_command.md @@ -29,6 +29,7 @@ A **Connector** is a web service which acts as a common API to all third party s First, go to [http://requestb.in/](http://requestb.in/) and `Create a RequestBin`. Replace the URL value with the one provided by RequestBin. Now run this command + ```shell factor run web::post '{"url":"http://requestb.in/1h15g3i1","params":{"foo":"bar"}}' ``` diff --git a/source/learn/step_3_your_first_workflow.md b/source/learn/step_3_your_first_workflow.md index 3082c02..5d40ba0 100644 --- a/source/learn/step_3_your_first_workflow.md +++ b/source/learn/step_3_your_first_workflow.md @@ -10,6 +10,8 @@ In previous steps we ran commands from the command line. However, in most cases # Add the Timer Connector to connectors.yml In the last example we used the `Web` connector, now we want to add the `Timer` connector. +**connectors.yml** + ```yaml --- web: wss://open-connectors.factor.io/v0.4/web @@ -90,4 +92,4 @@ When you run this command, you should see output like this. [ INFO ] [11/20/14 14:30:53.113] post complete ``` -Based on the workflow definition, the last 7 lines will be logged over and over again every minute. +In just a few lines of code we recreated functionality of services like [EasyCron](https://www.easycron.com/) or open source projects like [minicron](https://github.com/jamesrwhite/minicron). diff --git a/source/learn/step_4_getting_more_services.md b/source/learn/step_4_getting_more_services.md index 217ac3f..8c1cc25 100644 --- a/source/learn/step_4_getting_more_services.md +++ b/source/learn/step_4_getting_more_services.md @@ -41,7 +41,6 @@ github: api_key: b6c57341e27182c62a7be35d21027c759894d1b8 heroku: api_key: c5cf88930faee3bd5297fd50d4ce9a43 - ``` This is a new file with your credentials. This allows you to store the credentials outside of your workflow. You should add the `credentials.yml` file to your `.gitignore` file if you commit this code to git.