Cisco UCS Director REST 開発者ガイド、リリース 5.2
JSON オブジェクト
JSON オブジェクト

JSON オブジェクト

この章は、次の内容で構成されています。

JSON オブジェクト パラメータ タイプ

JSON オブジェクトは、レポート形式のデータよりも容易に渡すことができ、マシンが処理しやすい一貫した形式のデータを含みます。 JSON オブジェクトは API 要求と応答の両方に使用されます。

JSON オブジェクトは順序付けされない名前/値のペアのセットであるため、XML のように一目瞭然ですが、より軽量です。


(注)  


データ ペイロードが大きい他のデータ タイプの例は、レポートおよび JSON オブジェクト応答サンプルを参照してください。


JSON オブジェクト用のパラメータは、ParameterName:parameterValue の形式で渡されます。 正しい JSON オブジェクトは {(左の中括弧)で始まり、}(右の中括弧)で終わります。 ペアの各名前の後ろには、:(コロン)が付き、その後ろに対応する値が続きます。 名前/値のペアは、コンマで区切られます。

JSON の例:APIVDCDetails

userAPICreateVDC API は、APIVDCDetails オブジェクトを使用して仮想データ センター(vDC)を作成します。

  • vDC タイプが Hyper-V の場合は、deploymentPolicy パラメータに展開ポリシー名を指定し、systemPolicy パラメータに null 値を指定します。

  • vDC タイプが VMware の場合は、deploymentPolicy パラメータに null 値を指定し、systemPolicy パラメータにシステム ポリシー名を指定します。

次のサンプルに、Hyper-V タイプの vDC の場合のこの JSON オブジェクトの有効な名前/値ペアの例を示します。

 
"vdcName": "customerTest",
"vdcDescription": "customerTest",
"cloudName": "TestHyperV",
"groupName": "1",
"approver1": null,
"approver2": null,
"vdcSupportEmail":"name@company.com",
"vdcCustomerNoticationEmail":"name@company.com",
"systemPolicy": null,
"deploymentPolicy":"default-d",
"slaPolicy": null,
"computingPolicy": "default",
"storagePolicy": "default",
"networkPolicy": "default",
"costModel": "Default Cost Model",
"isLocked": false,
"isDeletable": false,
"isSelfServicePowerMgmt": false,
"isSelfServiceResize": false,
"isSelfServiceDeleteVM": false,
"isSelfServiceSnapshotMgmt": false,
"inactivityPeriodForDeletion": -1
 

次のサンプルに、VMware タイプの vDC の場合のこの JSON オブジェクトの有効な名前/値のペアの例を示します。

"vdcName":"VMware VDC",
"vdcDescription":"VMware Based VDC",
"cloudName":"DFA vCenter",
"groupName":1,
"approver1":"",
"approver2":"",
"vdcSupportEmail":"name@company.com",
"vdcCustomerNoticationEmail":"",
"systemPolicy":"SystemPolicy",
"deploymentPolicy":"",
"slaPolicy":null,
"computingPolicy":"DFA vCenter - Default Computing Policy",
"storagePolicy":"DFA vCenter - Default Storage Policy",
"networkPolicy":"DFA vCenter - Default Network Policy",
"costModel":"Default Cost Model",
"isLocked":true,
"isDeletable":true,
"isSelfServicePowerMgmt":true,
"isSelfServiceResize":true,
"isSelfServiceDeleteVM":true,
"isSelfServiceSnapshotMgmt":true,
"isSelfServiceDiskMgmt":true,
"isSelfServiceNetMgmt":true,
"inactivityPeriodForDeletion":1

JSON の例:APICatalogItem

次の表にこの JSON オブジェクトの有効な名前/値ペアの例を示します。

 
"catalogItemId":-1,
"catalogItemName":"CATFOR API",
"catalogItemDescription":null,
"cloudName":"VMware161",
"imageId":"Linux-SJ-PROD-Template",
"groups":"QAgroup",
"isAppliedToAllGroups":false,
"supportEmail":"name@company.com",
"vdcCategoryId":1,
"appList":null,
"otherApps":null,
"os":-1,
"otherOS":null,
"templateUser":null,
"templatePassword":null,
"credentialOption":1
 

JSON の例:APIUserOnBoardParams

次の表にこの JSON オブジェクトの有効な名前/値ペアの例を示します。

 
"firstName":"John",
"lastName":"Smith",
"userID":"jsmith",
"passWord":"test123",
"role":"GroupAdmin",
"contactEmail":"jsmith@company.com",
"companyName":"test",
"vdcProfileName":"VDC smith",
"vdcName":"myvdc",
"billFrequency":"",
"additionalInfo":"test
 

JSON の例:APIUserOnBoardDetails

次の表にこの JSON オブジェクトの有効な名前/値ペアの例を示します。

 
"groupID":"12"
"groupName":"test"
"vdcID":"5"
"vdcName":"myvdc"
 

JSON の例:APILoginProfile

次の表にこの JSON オブジェクトの有効な名前/値ペアの例を示します。

 
"userId":"jsmith"
"firstName":"John"
"lastName":"Smith"
"email":"jsmith@company.com"
"groupName":"test"
"groupId":"12"
"role":"GroupAdmin"
 

JSON の例:APIMakePaymentParams

次の表にこの JSON オブジェクトの有効な名前/値ペアの例を示します。

 
"userID":"jsmith"
"ordered":"123"
"amount":"1000"
"companyName":"Test"
"status":"success"
"timestamp":"1308647424609"
 

JSON の例:APIProvisionParams

次の表にこの JSON オブジェクトの有効な名前/値ペアの例を示します。

 
{
  param0: {
    "catalogName": "sample",
    "vdcName": "sample",
    "userID": "sample",
    "durationHours": 1000,
    "beginTime": 0,
    "quantity": 1000,
    "memoryMB": 0,
    "diskGB": 1000,
    "cores": 1000,
    "estimatedCost": 1000.0,
    "comments": "sample",
    "additionalInfo": "sample",
    "chargeFrequency": 1000,
    "nicAliasName": "sample",
    "nicPortGroupName": "sample",
    "resourceAllocated": true,
    "allocatedHost": "sample",
    "allocatedDataStore": "sample",
    "allocatedResourcePool": "sample",
    "altAllocatedHost": "sample",
    "altAllocatedDataStore": "sample",
    "altAllocatedResourcePool": "sample",
    "customStartupMemory": 1000.0,
    "customMaxMemory": 1000.0,
    "customMemoryBuffer": 1000.0,
    "customMemoryConfig": true,
    "customStoragePolicy": "sample",
    "allocatedCluster": "sample",
    "customCpuSockets": 1000,
    "customCpuCoresPerSocket": 1000,
    "altAllocatedCluster": "sample",
    "allocatedAddnlDatastores": "sample",
    "altAllocatedAddnlDatastores": "sample",
    "altAllocatedAddnlVNICs": "sample",
    "altAllocatedAddnlVNICsIpv6": "sample",
    "selectedDiskDataStore": "sample",
    "actionId": "sample",
    "vmName": "sample",
    "vdcCategory": "sample",
    "windowsLicensePool": "sample",
    "templateUserId": "sample",
    "templatePassword": "sample",
    "credentialOption": "sample",
    "provisionAllDisk": true,
    "enableGuestCustomization": true,
    "enablePostProvisioningCustomActions": true,
    "workflow": "sample",
    "vmId": 1000,
    "vMAppChargeFrequency": 1000,
    "activeVMAppCost": 1000.0,
    "inactiveVMAppCost": 1000.0,
    "useLinkedClone": true,
    "snapshotId": 1000,
    "snapshotKey": "sample",
    "newSnapshotName": "sample",
    "isHighlyAvailable": true,
    "postProvWFUserInputs": {
      "list": [
        {
          "name": "sample",
          "value": "sample"
        },
        {
          "name": "sample",
          "value": "sample"
        }
      ]
    }
  }
}

 

JSON の例:APIServiceContainerTemplate

次の表にこの JSON オブジェクトの有効な名前/値ペアの例を示します。

 
{
	"templateId":1000,
	"templateType":"sample",
	"templateName":"test SDK TemplateName ",
	"templateDescription":"test SDK templateDescription ",
	"containerType":"sample",
	"templateDefinitionData":"sample",
	"templateConfig":{
		"vInfraPolicy":"cloud82",
		"networks":[
			{
				"networkName":"lan0",
				"networkType":1000,
				"vlanIDPool":"100-199",
				"networkPool":1000,
				"ipSubnetPool":1000,
				"networkIP":"10.10.10.0",
				"networkMask":"255.255.255.0",
				"gatewayIP":"10.10.10.1"
			},
			{
				"networkName":"lan1",
				"networkType":1000,
				"vlanIDPool":"200-299",
				"networkPool":1000,
				"ipSubnetPool":1000,
				"networkIP":"20.20.20.0",
				"networkMask":"255.255.255.0",
				"gatewayIP":"20.20.20.1"
			}
		],
		"dfaNetworks":[
			{
				"networkName":"sample",
				"networkRole":"sample",
				"description":"sample",
				"networkType":1000,
				"profileName":"sample",
				"gatewayIP":"sample",
				"networkMask":"sample",
				"dhcpServerAddress":"sample",
				"gatewayIpv6Address":"sample",
				"prefixLength":"sample",
				"startIP":"sample",
				"endIP":"sample",
				"secondaryGateway":"sample"
			},
			{
				"networkName":"sample",
				"networkRole":"sample",
				"description":"sample",
				"networkType":1000,
				"profileName":"sample",
				"gatewayIP":"sample",
				"networkMask":"sample",
				"dhcpServerAddress":"sample",
				"gatewayIpv6Address":"sample",
				"prefixLength":"sample",
				"startIP":"sample",
				"endIP":"sample",
				"secondaryGateway":"sample"
			}
		],
		"vnmcFirewallConfig":{
			"networkName":"sample",
			"ipAddress":"sample"
		},
		"vnmcZones":[
			{
				"zoneName":"sample",
				"zoneDesc":"sample",
				"vnmcZoneRules":[
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					},
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					}
				]
			},
			{
				"zoneName":"sample",
				"zoneDesc":"sample",
				"vnmcZoneRules":[
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					},
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					}
				]
			}
		],
		"vnmcAcls":[
			{
				"name":"sample",
				"descr":"sample",
				"firewallAction":"sample",
				"matchCriteria":"sample",
				"protocolServiceOption":"sample",
				"protocol":true,
				"protocalOperator":"sample",
				"protocalValue":"sample",
				"services":[
					{
						"protocalOperator":"sample",
						"protocalValue":"sample",
						"serviceName":"sample",
						"servicePort":1000,
						"errormessage":"sample"
					},
					{
						"protocalOperator":"sample",
						"protocalValue":"sample",
						"serviceName":"sample",
						"servicePort":1000,
						"errormessage":"sample"
					}
				],
				"srcRules":[
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"zoneAttributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					},
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"zoneAttributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					}
				],
				"destRules":[
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"zoneAttributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					},
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"zoneAttributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					}
				]
			},
			{
				"name":"sample",
				"descr":"sample",
				"firewallAction":"sample",
				"matchCriteria":"sample",
				"protocolServiceOption":"sample",
				"protocol":true,
				"protocalOperator":"sample",
				"protocalValue":"sample",
				"services":[
					{
						"protocalOperator":"sample",
						"protocalValue":"sample",
						"serviceName":"sample",
						"servicePort":1000,
						"errormessage":"sample"
					},
					{
						"protocalOperator":"sample",
						"protocalValue":"sample",
						"serviceName":"sample",
						"servicePort":1000,
						"errormessage":"sample"
					}
				],
				"srcRules":[
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"zoneAttributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					},
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"zoneAttributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					}
				],
				"destRules":[
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"zoneAttributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					},
					{
						"attributeType":"sample",
						"attributeName":"sample",
						"operator":"sample",
						"attributeValue":"sample",
						"zoneAttributeValue":"sample",
						"prefixedIpAddressValue":"sample",
						"prefixedSubnetValue":"sample"
					}
				]
			}
		],
		"vms":[
			{
				"templateName":"sample",
				"zone":"sample",
				"appName":"VM1",
				"appDescription":"sample",
				"imageId":"FC_Gateway",
				"numVCPUs":1000,
				"memoryMB":1000,
				"cpuReservationMHz":1000,
				"memoryReservationMB":1000,
				"diskSize":1000,
				"passwordResetType":1000,
				"templateRootLogin":"sample",
				"templateRootPassword":"sample",
				"appCategory":"sample",
				"isUseImageNetwork":true,
				"networks":[
					{
						"appName":"nic1",
						"networkName":"lan0",
						"adapterType":"e1000",
						"ipAddress":"10.10.10.1",
						"enablePublicIPMapping":true
					},
					{
						"appName":"nic2",
						"networkName":"lan1",
						"adapterType":"e1000",
						"ipAddress":"20.20.20.1",
						"enablePublicIPMapping":true
					}
				],
				"maxQuantity":1000,
				"initialQuantity":1000,
				"isStorageEfficiencyEnabled":true
			},
			{
				"templateName":"sample",
				"zone":"sample",
				"appName":"sample",
				"appDescription":"sample",
				"imageId":"sample",
				"numVCPUs":1000,
				"memoryMB":1000,
				"cpuReservationMHz":1000,
				"memoryReservationMB":1000,
				"diskSize":1000,
				"passwordResetType":1000,
				"templateRootLogin":"sample",
				"templateRootPassword":"sample",
				"appCategory":"sample",
				"isUseImageNetwork":true,
				"networks":[
					{
						"appName":"sample",
						"networkName":"sample",
						"adapterType":"sample",
						"ipAddress":"sample",
						"enablePublicIPMapping":true
					},
					{
						"appName":"sample",
						"networkName":"sample",
						"adapterType":"sample",
						"ipAddress":"sample",
						"enablePublicIPMapping":true
					}
				],
				"maxQuantity":1000,
				"initialQuantity":1000,
				"isStorageEfficiencyEnabled":true
			}
		],
		"portMappings":[
			{
				"protocol":6,
				"mappedPort":80,
				"remoteIP":"10.10.10.2",
				"remotePort":80
			},
			{
				"protocol":1000,
				"mappedPort":1000,
				"remoteIP":"sample",
				"remotePort":1000
			}
		],
		"outboundACLs":[
			{
				"protocol":6,
				"network":"lan0",
				"srcCIDR":"0.0.0.0/0",
				"destCIDR":"0.0.0.0/0",
				"srcPortRange":"sample",
				"destPortRange":"sample",
				"fireallAction":0
			},
			{
				"protocol":1000,
				"network":"sample",
				"srcCIDR":"sample",
				"destCIDR":"sample",
				"srcPortRange":"sample",
				"destPortRange":"sample",
				"fireallAction":1000
			}
		],
		"policies":{
			"virtualComputePolicy":"Cloud82 - Default Computing Policy",
			"virtualStoragePolicy":"Cloud82 - Default Storage Policy",
			"virtualNetworkPolicy":"Cloud82 - Default Network Policy",
			"virtualSystemPolicy":"system test",
			"costModel":"Default Cost Model ",
			"userActionPolicy":"sample"
		},
		"options":{
			"isSelfServicePowerMgmt":true,
			"isSelfServiceResize":true,
			"isSelfServiceSnapshotMgmt":true,
			"isSelfServiceDeleteVM":true,
			"isSelfServiceDeleteContainer":true,
			"isConsoleAccess":true,
			"supportEmails":"sougoyal@cisco.com"
		},
		"gatewayConfig":{
			"gwPolicy":"sample",
			"networkMapping":[
				{
					"network":"sample",
					"networkIP":"sample",
					"interfaceName":"sample"
				},
				{
					"network":"sample",
					"networkIP":"sample",
					"interfaceName":"sample"
				}
			],
			"isConfigGateway":true
		},
		"workflowConfig":{
			"setupWorkflow":"Fenced Container Setup"
		},
		"templateName":"sample"
	}
}
}