Data Formats Flashcards

1
Q

What are the three popular standard formats for exchanging information with remote APIs

A

XML, JSON and YAML

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

What is the first step in interacting with a REST interface

A

Authenticate, usually by POSTing a user/password combination and retrieving an expiring token for use in authenticating subsequent requests.

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

What is the second step in interacting with a REST interface

A

Execute a GET request to a given endpoint (authenticating as required) to retrieve the state of a resource, requesting XML, JSON, or YAML as the output format.

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

What is the third step in interacting with a REST interface

A

Modify the returned XML, JSON, or YAML.

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

What is the fourth step in interacting with a REST interface

A

Execute a POST (or PUT) to the same endpoint (again, authenticating as required) to change the state of the resource, again requesting XML, JSON, or YAML as the output format and interpreting it as needed to determine if the operation was successful.

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

What is Extensible Markup Language (XML)

A

is a derivative of Structured, Generalized Markup Language (SGML), and also the parent of HyperText Markup Language (HTML). XML is a generic methodology for wrapping textual data in symmetrical tags to indicate semantics. XML filenames typically end in “.xml”.

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

What type of data format is this an example of

0101af9811012
t1.nano

0102bg8908023
t1.micro
A

XML

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

Which data format is user defined tag based?

A

XML

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

In XML what is the prologue abd what does it contain

A

The first line in an XML file and contains the tag name xml and attributes
EX.

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

How do you write a comment in XML

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

In XML what are three things to know about attributes

A

Attribute values must always be included in single or double quotes.
An element may have multiple attributes, but only one attribute with a specific name.
If an element has no content, we can use a shorthand notation in which we put the slash inside the open tag, rather than including a closing tag.

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

In XML why should you use namespace references

A

to specify particular tagnames and how they should be used in various contexts

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

What is this an example of

A

A reference to a namespace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
In XML what is this an example of 
vms [
  {
    {"vmid": "0101af9811012"},
    {"type": "t1.nano"}
  },
  {
    {"vmid": "0102bg8908023"},
    {"type": "t1.micro"}
  }  
]
A

An instance which is just an a dictionary in XML

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

What is JSON JavaScript Object Notation

A

a data format derived from the way complex object literals are written in JavaScript (which is in turn, similar to how object literals are written in Python)

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

What is this code an example of

A
{
  "edit-config":
  {
    "default-operation": "merge",
    "test-operation": "set",
    "some-integers": [2,3,5,7,9],
    "a-boolean": true,
    "more-numbers": [2.25E+2,-1.0735],
  }
}
17
Q

What JSON basic data types?

A

numbers (written as positive and negative integers, as floats with decimal, or in scientific notation), strings, Booleans (‘true’ and ‘false’), or nulls (value left blank).

18
Q

What are objects in JSON

A

individual objects in JSON comprise key/value pairs, which may be surrounded by braces, individually:
EX. {“keyname”: “value”}

19
Q

What does JSON not support

A

comments

20
Q

What is insignifiacnt in JSON

A

Whitespaces meaning it doesnt care about them

21
Q

What does YAML stand for

A

YAML Ain’t Markup Language,

22
Q

What is YAML and why is it used

A

superset of JSON designed for even easier human readability. It’s becoming more common as a format for configuration files, and particularly for writing declarative automation templates for tools like Ansible.

23
Q
What is this code an example of 
---
edit-config:
  a-boolean: true
  default-operation: merge
  more-numbers:
  - 225.0
  - -1.0735
  some-integers:
  - 2
  - 3
  - 5
  - 7
  - 9
  test-operation: set
...
A

YAML

24
Q

Can JSON parse YAML documents?

A

No only YAML can parse JSON documents

25
Q

How does a YAML file open and close

A

With three dots

EX. …

26
Q

What is this code an example of
mymap:
myfirstkey: 5
mysecondkey: The quick brown fox

A

A map - baiscally a dictionary

27
Q
What is this code an example of 
mylist:
- 1
- 2
- 3
A

A list in YAML

28
Q

How do you write a comment in YAML

A

this is a comment

29
Q

What does parsing mean

A

analyzing a message, breaking it into its component parts, and understanding their purposes in context