From 4c21757dae09703021460df9d047ef0a5d65f653 Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Thu, 11 Aug 2016 12:45:32 -0700 Subject: [PATCH] Reformatting --- docs/leveraging-the-library.md | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/leveraging-the-library.md b/docs/leveraging-the-library.md index a65e48b..cc74b59 100644 --- a/docs/leveraging-the-library.md +++ b/docs/leveraging-the-library.md @@ -1,60 +1,60 @@ -### How to leverage the library (based on the [sample client](../examples/client.go)) +# How to leverage the library (based on the [sample client](../examples/client.go)) -Create a default configuration file (alternatively, manually create your own Config): +For a more complete look at the API, please visit https://godoc.org/github.com/rdelval/gorealis + +* Create a default configuration file (alternatively, manually create your own Config): ``` config, err := realis.NewDefaultConfig(*url) ``` -Create a new Realis struct by passing the configuration struct in: +* Create a new Realis client by passing the configuration struct in: ``` r := realis.NewClient(config) defer r.Close() ``` -Construct a job using an AuroraJob struct. +* Construct a job using a Job struct: ``` -job = realis.NewJob().Environment("prod"). +job = realis.NewJob(). + Environment("prod"). Role("vagrant"). - Name("hello_world_from_gorealis"). + Name("docker-compose"). ExecutorName("docker-compose-executor"). ExecutorData("{}"). - NumCpus(1). - Ram(64). - SetDisk(100). + CPU(1). + RAM(64). + Disk(100). IsService(false). InstanceCount(1). AddPorts(1). - AddLabel("fileName", "sample-app/sample-app.yml"). - AddURI("https://dl.bintray.com/rdelvalle/mesos-compose-executor/sample-app.tar.gz", true, true) - + AddLabel("fileName", "sample-app/docker-compose.yml"). + AddURI("https://github.com/mesos/docker-compose-executor/releases/download/0.1.0/sample-app.tar.gz", true, true) ``` -Use client to send a job to Aurora: +* Use client to send a job to Aurora: ``` r.CreateJob(job) ``` -Killing an Aurora Job: +* Killing an Aurora Job: ``` r.KillJob(job.GetKey()) ``` -Restarting all instances of an Aurora Job: +* Restarting all instances of an Aurora Job: ``` r.RestartJob(job.GetKey()) ``` -Adding instances (based on config of instance 0) to Aurora: +* Adding instances (based on config of instance 0) to Aurora: ``` r.AddInstances(&aurora.InstanceKey{job.GetKey(),0}, 5) ``` -Updating the job configuration of a service job: +* Updating the job configuration of a service job: ``` updateJob := realis.NewUpdateJob(job) updateJob.InstanceCount(1) updateJob.Ram(128) - msg, err := r.UpdateJob(updateJob, "") -``` - +``` \ No newline at end of file