nerdexam
Cisco

300-635 · Question #62

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…

Sign in or unlock 300-635 to reveal the answer and full explanation for question #62. The question stem and answer options stay visible for context.

Cisco Intersight

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']
    )
    

Unlock 300-635 to see the answer

You've previewed enough free 300-635 questions. Unlock 300-635 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#Intersight REST API#OData Query Syntax#JSON Parsing#UCS Server Management
Full 300-635 Practice