Chapter 4 Flashcards

1
Q

____ help to:

avoid a server overload from too many requests at once

provide better service and response time to all users

protect against a denial-of-service (DoS) attack

A

Rate Limits

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

Rate limits commom algorithms:

A

Leaky bucket

Token bucket
	
Fixed window counter
	
Sliding window counter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Puts all incoming requests into a request queue in the order in which they were received.

A

Leaky bucket (Rate limit)

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

Gives each user a defined number of tokens they can use within a certain increment of time, and those tokens accumulate until they’re used.

A

Token Bucket

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

-It uses a counter rather than a collection of tokens.
-The counter cannot be accumulated.

A

-Fixed Window

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

Allows a fixed number of requests to be made in a set duration of time. This duration of time is not a fixed window and the counter is not replenished when the window begins again.

A

The sliding window (Rate limit)

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

HTTP 429

A

Too many requests

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

Is an HTTP callback, or an HTTP POST, to a specified URL that notifies your application when a particular activity or “event” has occurred in one of your resources on the platform.

A

Webhook

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

Webhooks are also known as…..

A

reverse APIs

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

-The application must be running at all times to receive HTTP POST requests.

-The application must register a URI on the webhook provider so that the provider knows where to send a notification when target events occur.

A

requirements for receiving a notification from a webhook provide.

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

import requests
uri = “sandboxdnac.cisco.com/dna/intent/api/v1/network-device”
resp = requests.get(uri, verify = False)

A

Invalid URI example

R/ Perhaps you meant http://sandboxdnac.cisco.com/dna/intent/api/v1/network-device?….

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

import requests
url = “https://sandboxdnac123.cisco.com/dna/intent/api/v1/network-device”
resp = requests.get(url, verify = False)

….requests.exceptions.ConnectionError: HTTPSConnectionPool(host=’sandboxdnac123.cisco.com’, port=443): Max retries exceeded with url: /dna/intent/api/v1/network-device (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x109541080>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known’))….

A

Wrong domain name

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

Status code categories:

A

-1xx: Informational: Request received, continuing to process.-

-2xx: Success: The action was successfully received, understood, and accepted.-
	
-3xx: Redirection: Further action must be taken in order to complete the request.-
	
-4xx: Client Error: The request contains bad syntax or cannot be fulfilled.-
	
-5xx: Server Error: The server failed to fulfill an apparently valid request.-
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Use cases for APIs….

A

Automation tasks
-Build a script tat performs your manual tasks automatically and programmatically.- (administration software)

Data integration-
-An application can consume or react to data provided by another application. (e-comerce website)-

Functionality
-An application can integrate another application’s functionality into it;s product. (Uber + Google maps)-

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

It is an architecture style for designing web service applications.

A

REST

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

HTTP Status 201

A

Request to update de database is completed

17
Q

SOAP elements….

A

Envelope
Head
Body
Fault

18
Q

Rest APIs basic autentication code…

A

Base64

19
Q

What is webhook for REST APIs

A

It is an HTTP PUT message to update information on a website.

20
Q

6 REST constrains…..

A

Client-Server
Stateless
Cache
Uniform Interface
Layered System
Code-On-Demand

21
Q

1xx:
2xx:
3xx:
4xx:
5xx:

A

Informational: Request received, continuing to process.

Success: The action was successfully received, understood, and accepted.

Redirection: Further action must be taken in order to complete the request.

Client Error: The request contains bad syntax or cannot be fulfilled.

Server Error