Question 54 of 100 from exam 350-901-DEVCOR: Developing Applications Using Cisco Core Platforms and APIs

Question 54 of 100 from exam 350-901-DEVCOR: Developing Applications Using Cisco Core Platforms and APIs

Question

Click on the GET Resource button above to view resources that will help with this question.

“Greater Than” Operator

The gt operator returns true is the left operand is greater than the right operand, otherwise it returns false. The gt operator accepts
numeric, dates and string values.

Example: Query RackUnit resources where AvailableMemory is greater than 98304MB:
GET /api/v1/compute/RackUnits?$filter-AvailableMemory gt 98304

Example: Query Audit log records where ‘CreationTime” is greater than '2018-06-20705:31:38.862Z.. The date must be specified in UTC
time without quotes.

GET /api/v1/aaa/AuditRecords?$filter
“Less Than” Operator

The It operator returns true is the left operand is less than the right operand, otherwise it returns false. The It operator accepts numeric,
dates and string values.

Example: Query RackUnit resources where AvailableMemory is less than 98304MB:

GET /api/v1/compute/RackUnits$filter-AvailableMemory 1t 98304

“Greater Than Or Equal” Operator

The ge operator returns true if the left operand is greater than or equal to the right operand, otherwise it returns false. The ge operator
accepts numeric, dates and string values.

Example: Query RackUnit resources where AvailableMemory is greater than or equal to 98304MB:
Get /api/v1/compute/RackUnits?$filter-AvailableMemory ge 98304
“Less Than Or Equal” Operator

The le operator returns true if the left operand is less than or equal to the right operand, otherwise it returns false. The le operator
accepts numeric, dates and string values.

Example: Query RackUnit resources where AvailableMemory is less than or equal to 98304MB:

GET /api/v1/compute/RackUnits?$filter-AvailableMemory le 98304
“And” Operator
The and operator returns true if both the left and right operands evaluate to true, otherwise it returns false.

Example: Query RackUnit resources where the Model property is equal to 'UCSC-C240- MSSN’ and thy server has more than 64GB of
memory:

lter-Model eq ‘Ui

“Or* Operator

The or operator returns true if either the left or right operand evaluate to true, otherwise it returns false.

Example: Query RackUnit resources where the Model property is equal to ‘UCSC-C240-MSSN’ or the Model property is equal to
"UCSC-C240-MSSN’. Use the $select keyword to reduce the size of the output JSON document.

“Not” Operator
The not operator returns true if the operand returns false, otherwise it returns false.

Example: Query RackUnit resources where the model property is not ('HX220C-MSSX' or ‘HX220C-M5S’. The example shows how
grouping parenthesis can be used to set the operator precedence.

GET /api/v1/compute/RackUnits?$select=Vendor ,Model , Serial &top=10&$filter=not (Model eq

‘HX220C-M5SX' or Model eq 'HX220C-M5S’ )

“In” Operator

The in operator returns true if the left operand is equal to one of the values specified in the right operand, otherwise it returns false.
The in operator accepts numeric and string values.

Values must be specified as a comma-separated list enclosed in parenthesis.

Example: Query RackUnit resources where the Model is either ‘HX220C-MSSX' or ‘UCSC-C240-MSSN’.

Get /api/v1/compute/RackUnits?$filter=Model in (‘HX220C-MS5SxX' , 'UCSC-C240-M5SN’ )
String Functions

“contains” Function

The contains function has the following signature:
boolean contains(s string, subst string)

The contains function retums true if the second parameter string value is a substring of the first parameter string value, otherwise it
returns false.

Example: Query RackUnit resources where the value of the ‘Model’ property contains ‘C240

GET /api/v1/RackUnits?$filter-contains (Model , ‘C240')

The startswith function has the following signature:

boolean startswith(s string, subst string)

The startswith function returns true if the first parameter string value starts with the second parameter string value, otherwise it
returns false.

Example: Query RackUnit resources where the value of the ‘Model’ property starts with the prefix ‘UCSC-C240’

GET /api/v1/RackUnits?$filter=startswi th (Model, 'UCSC-C240’)

“endswith” Function
The endswith function has the following signature:
boolean endswith(string, suffix string)

The endswith function returns true if the first parameter string value ends with the second parameter string value, otherwise it returns
false.

Example: Query RackUnit resources where the value of the ‘Model’ property ends with the suffix MS°

GET /api/v1/RackUnits?$filter-endswith (Model , 'M5’)

“tolower™ Fun nm
The tolower function has the following signature:

string tolower(string)

An engineer is managing a data center with 6000 Cisco UCS servers installed and running.

The engineer has been asked to identify all resources where the model is in the UCSB family and the available memory is less than or equal to 5 GB.

Which REST API call accomplishes this task?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.