be the api - vmware usercon 2016
TRANSCRIPT
![Page 1: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/1.jpg)
Be The APIan exploration of careers, supported by code and memes
by @mjbrender
![Page 2: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/2.jpg)
![Page 3: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/3.jpg)
Business Logic
![Page 4: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/4.jpg)
The Happy Place
![Page 5: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/5.jpg)
![Page 6: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/6.jpg)
The Happy Place
![Page 7: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/7.jpg)
![Page 8: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/8.jpg)
My Less Happy Place
![Page 9: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/9.jpg)
![Page 10: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/10.jpg)
No, Not Again
![Page 11: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/11.jpg)
![Page 12: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/12.jpg)
“Hey, Sisyphus, when you’ve got a minute I’d like to discuss this progress report with you.”
![Page 13: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/13.jpg)
> cd $HOME>>> bash ./admin_scriptfixing foo
![Page 14: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/14.jpg)
![Page 15: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/15.jpg)
![Page 16: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/16.jpg)
> vim ./admin_script
cmd | xarg –n 1 sed –i “s/server/foo/g” | grep -i up >err.log 2>&1
![Page 17: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/17.jpg)
“An Application Programming Interface is a set of routines, protocols, and tools for building software applications.”
![Page 19: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/19.jpg)
![Page 20: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/20.jpg)
Structured input and output
![Page 21: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/21.jpg)
vSphere API
source
![Page 22: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/22.jpg)
Many Other APIsJSON
JSON
![Page 23: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/23.jpg)
is the API the new CLI
?
![Page 24: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/24.jpg)
![Page 25: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/25.jpg)
> cmd
| grep | sed | awk
![Page 26: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/26.jpg)
the API the new CLI
(if and only if you use the CLI like this example)
![Page 27: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/27.jpg)
> cmd
| grep | sed | awk
![Page 28: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/28.jpg)
JSON
JSON
![Page 29: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/29.jpg)
JSON
JSON
![Page 30: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/30.jpg)
API is a machine interface CLI is a user interfaceGUI is a user interface
![Page 31: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/31.jpg)
An API says:
Request this.
Get that.
![Page 32: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/32.jpg)
{you}
![Page 33: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/33.jpg)
![Page 34: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/34.jpg)
{myapi}
![Page 35: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/35.jpg)
serverAPI
myctl
{myapi} service
![Page 36: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/36.jpg)
GET job/Return a description of my job.
There are no options available for this endpoint.
![Page 37: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/37.jpg)
> myctl job list
Matt is a Developer Advocate. Developer Advocates are technical community contributors key to accelerating project adoption through internal coordination & targeted external contribution.
![Page 38: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/38.jpg)
GET contact/Returns a list of available forms of contact.
typerequired
Return whether the contact is personal or professionalValues: personal, professional, all
include_preferenceoptional
Boolean preference as defined by the serviceExample Value: true
include_reply_timeoptional
Return average response time for requestExample Value: false
Response formats JSON
Requires authentication? No
Rate limited? Yes
![Page 39: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/39.jpg)
curl http://localhost/v1/contact?type=all
{ ”contact":{ ”email": [ { “type": “professional", “to": “REDACTED", }, { “type": “personal", “to": “REDACTED", }, ], ”tweet": [ { "type": “personal”, “to": “@mjbrender", } ], ”call": [ { "type": “personal”, “to": “+REDACTED", } ] } }
![Page 40: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/40.jpg)
> myctl contact list --all
TYPE PREFERENCE REPLY TIMEemail 2 3dtext 3 1mtweet 1 30scall 4 5d
![Page 41: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/41.jpg)
PUT contact/[:to]Request that gets in contact with the API owner. Returns string response to the request.
fromrequired
Return location appropriate for the endpointExample Value: @mjbrender, [email protected]
messagerequired
Reason for the contactExample Value: “Thought you’d like this post”
urgencyoptional
Definition of how quickly a reply is required.Values: Low, Medium, High
include_lead_timeoptional
Boolean to include approximate time to respond.Example Value: true
![Page 42: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/42.jpg)
curl -H “Content-Type: application/json”
-X POST –d ‘{“from”: “@vBrianGraf”, “description”: “Hey!”}
http://localhost/v1/contact/@mjbrender
{ ”confirmation": “Thanks for getting in touch. I’ll response back as soon as time allows.” }
![Page 43: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/43.jpg)
{ ”confirmation": “Thanks for getting in touch. Since this involves something urgent, I’ll get back to you as soon as I can.” }
curl -H “Content-Type: application/json”
-X POST –d ‘{“from”: “[email protected]”, “description”: “House on Fire”,“urgency”: “high”}
http://localhost/v1/contact/[email protected]
![Page 44: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/44.jpg)
GET job/skillReturns a list of advertised job skills.
typeoptional
Return the category of work this falls underValues: ENG, MKT, SALES, FINANCE, MGMT
include_preferenceoptional
Boolean preference as defined by the service provider. Defined on a scale from 1-7 with 7 as most preferredExample Value: 3
include_leveloptional
Boolean level of expertise of the service provider. Expertise is defined on a scale from 1-7 with 7 as bestExample Value: 7
Response formats JSON
Requires authentication? No
Rate limited? No
![Page 45: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/45.jpg)
> myctl skill list --type=ENG -p
SKILL TYPEPREFERENCEBuild Automation ENG 5Product Mgmt ENG 5Dev Mgmt ENG 4Traditional IT ENG 3Cloud Native ENG 7Ruby Developer ENG 3Go Developer ENG 3
![Page 46: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/46.jpg)
> myctl skill list --type=ENG -p
SKILL TYPEPREFERENCEBuild Automation ENG 5Product Mgmt ENG 5Dev Mgmt ENG 4Traditional IT ENG 3Cloud Native ENG 7Ruby Developer ENG 3Go Developer ENG 3
![Page 47: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/47.jpg)
> myctl skill list --type=ENG -l
SKILL TYPE SKILL LEVELBuild Automation ENG 2Product Mgmt ENG 5Dev Mgmt ENG 4Traditional IT ENG 5Cloud Native ENG 3Ruby Developer ENG 2Go Developer ENG 2
![Page 48: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/48.jpg)
> myctl skill list --type=ENG -l
SKILL TYPE SKILL LEVELBuild Automation ENG 2Product Mgmt ENG 5Dev Mgmt ENG 4Traditional IT ENG 5Cloud Native ENG 3Ruby Developer ENG 2Go Developer ENG 2
![Page 49: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/49.jpg)
> myctl skill list --type=MKT -l
SKILL TYPE SKILL LEVELPowerPoint ing MKT 6Podcasting MKT 6Blogging MKT 4Public Speaking MKT 4Product Messaging MKT 5Logo Design MKT 5Social Media MKT 5
![Page 50: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/50.jpg)
GET job/request/Review active work requests with expected completion dates.
typeoptional
Return the category of work this falls underValues: ENG, MKT, SALES, FINANCE, MGMT
include_preferenceoptional
Boolean preference as defined by the service providerExample Value: true
include_lead_timeoptional
Boolean to include default lead time per requestExample Value: true
Response formats JSON
Requires authentication? No
Rate limited? No
![Page 51: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/51.jpg)
> myctl work list -t -lt
REQUEST TYPE LEAD TIMECreate PPT MKT 7dDefine OSS Release ENG 5dTest Automation ENG 3dWrite Blog Post MKT 2dRe to Sales MGMT .5dSchedule Meeting MGMT .25dCreate other PPT MKT 7d
![Page 52: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/52.jpg)
PUT job/request/Request that gets in contact with the API owner. Returns expected response time.
titlerequired
Boolean preference as defined by the serviceExample Value: true
descriptionrequired
Return average response time for requestExample Value: false
urgencyrequired
Return average response time for requestExample Value: false
authorizedoptional
Return average response time for requestExample Value: true
![Page 53: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/53.jpg)
Valid Responses• “Here you go.”• “I can’t do that.”• “I’m on it. I’m estimating a delivery time of” + GET
job/requests/[:type]?lead_time• “I can’t help you with this right now, I’m at capacity. Please
contact my manager.”• “I can’t help you right now due to other urgent priorities.
Please contact my manager.”• “I will get on it right away. Here is the other work that will
be delayed by at least 2 business days by this request:” + GET job/requests/
![Page 54: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/54.jpg)
GETcontact/job/job/skill/job/request/
PUT contact/
job/request/
{myapi}
![Page 55: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/55.jpg)
What’s undocumented?
Endpoint
GET hobby/
Options
tone := Reflect.type(tone)
![Page 56: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/56.jpg)
An API says:
Request this.
Get that.
![Page 57: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/57.jpg)
API is a machine interface CLI is a user interfaceGUI is a user interface
![Page 58: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/58.jpg)
defining our API can help us be better humans
![Page 59: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/59.jpg)
> myctl contact list --best
TO PREFERENCE@mjbrender 1slack.snap-telemetry.io 2
![Page 60: Be The API - VMware UserCon 2016](https://reader031.vdocument.in/reader031/viewer/2022021814/58f2c8681a28ab101a8b459b/html5/thumbnails/60.jpg)