nerdexam
Cisco

300-635 · Question #62

300-635 Question #62: Real Exam Question with Answer & Explanation

The correct answer is B. ``` "https://www.intersight.com/api/v1/" + "compute/RackUnits?$select=DeviceMoid,Model,AssetTag" + "$filter=AssetTag eq 'DMZ-R-L2-ADJM'" ```. See the full explanation below for the reasoning.

Question

Refer to the exhibit above and click on the resource tabs in the top left corner to view resources to help with this question. An engineer is creating a Python script to update the firmware on a specific Cisco UCS Rack server that is managed by Cisco Intersight. The script uses the Cisco Intersight REST API. The value of the 'resource_path' key in the rackunitJson_body Python dictionary retrieves the server with the AssetTag DMZ-R-L2- ADJM. The AssetTag is assigned to only one server. The value of the 'Server' key must be set in the firm ware_json_body Python dictionary with a value from the query result. Which two Python statements, a GET request and a dictionary update, are required to complete the code? (Choose two.)
# Intersight
# Query for RackUnit
rackunit_json_body = {
 "Query": {
 "ResourceType": "GET",
 "resource_path": ""
 }
}
Query Results
"ObjectType": "compute.RackUnit.List",
"Results": [
 {
 "AssetTag": "DMZ-R-L2-ADJM",
 "ClassId": "compute.RackUnit",
 "CreateTime": "2022-04-26T20:43:00.432Z",
 "Model": "CSC-C220-M4SX",
 "ObjectType": "compute.RackUnit"
 }
]
firmware_json_body = {
 "request_method": "POST",
 "request_body": {
 "Firmware_Upload": {},
 "NetworkShare": {
 "Mapping": "/fws",
 "UpdExemption": "no_upgrade_full",
 "HttpServer": {
 }
 }
 },
 "UpgradeType": "network_upgrade",
 "Server": ""
}

RESPONSE = requests.request(
 method=firmware_json_body['request_method'],
 url=rackunit_json_body['resource_path'],
 auth=auth
)


RESPONSE = requests.request(
 method=firmware_json_body['request_method'],
 url=firmware_json_body['resource_path'],
 json=json.loads(firmware_json_body['request_body']),
 auth=auth
)

Options

  • A
    "https://www.intersight.com/api/v1/" +
    "compute/RackUnits?$select=DeviceMoid,Model,AssetTag&" +
    "$filter=AssetTag eq 'DMZ-R-L2-ADJM'
    
  • B
    "https://www.intersight.com/api/v1/" +
    "compute/RackUnits?$select=DeviceMoid,Model,AssetTag" +
    "$filter=AssetTag eq 'DMZ-R-L2-ADJM'"
    
  • C
    firmware_json_body['request_body']['Server'] = (
     json.loads(RESPONSE.text)['Results'][0]['DeviceMoid']
    )
    
  • D
    firmware_json_body['request_body']['Server'] = (
     json.loads(RESPONSE.text)['Results'][0]['AssetTag']
    )
    
  • E
    firmware_json_body['Server'] = (
     json.loads(RESPONSE.text)['Results'][0]['Server']
    )
    

Community Discussion

No community discussion yet for this question.

Full 300-635 Practice