REST & JSON Flashcards

1
Q

REST APIs: 6 attributes

A
Client/server architecture
stateless operation
clear statement of cacheable/uncacheable
uniform interface
layered
code-on-demand
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Client-server model steps:
1.
2.
3.

A
  1. REST client executes REST API call, generates message to REST server
  2. REST server on right has API code that considers request and decides how to reply
  3. REST server sends back reply message with appropriate data variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Stateless operation

A

REST does not record and use info about API exchanges to process subsequent API exchanges

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Cacheable/uncacheable

A

save vs/ don’t save data for later retrieval (like for websites)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
CRUD (REST APIs)- based of HTTP verbs
C
R
U
D
A

Create
Read
Update
Delete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
CRUD:REST (HTTP)
Create:
Read:
Update:
Delete:
A

Create: Post
Get: Read
Update: Patch
Delete: Delete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

URI structure:

https: //dnac.example.com/dna/intent/api/v1/network-device
1. https://
2. dnac.example.com
3. /dna/intent/api/v1/network-device

A
  1. Protocol
  2. hostname/address- sits between // and first /
  3. path (resource)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Resource & parameter

https://dnac.example.com/dna/intent/api/v1/network-device?parm1=10.1.1.1…

A

Resource- /dna/intent/api/v1/network-device

Parameter- ?parm=10.1.1.1…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

JSON

  1. name
  2. origin
  3. central purpose
  4. common use
A
Javascript object notation
RFC 8259. 
General data modeling and serialization
Rest APIS
addl:
{} start and stop list
readable by human and machine.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

XML

  1. name
  2. origin
  3. central purpose
  4. common use
A

eXtensible markup language. based off HTML.
World Wide Web Consortium
Data-focused text markup that allows data modeling
Rest APIs, web pages
addl:
Variables sit between tags. slightly harder to read than JSON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

YAML

  1. name
  2. origin
  3. central purpose
  4. common use
A
YAML Aint Markup Language.
YAML.org
General data modeling
Ansible
addl:
doesn't define markup details like XML. Focuses on data model details. Easiest to read. Starts with #. Denotes variables with {{ }}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

JSON

Key:value pair

A

each colon identifies pair

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

JSON

Key:

A

inside double “” before colon, used as the name that references a value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

JSON

Value

A

represents value of key-

text, numeric, array, object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

JSON

object

A

dictionary. list of Key:value pairs inside {}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

JSON

array

A

series of values inside []

17
Q

minified JSON

A

less spacing

18
Q

beautified/prettified JSON

A

more spacing for readability