phpAx / Core Services API / BulkAddVirtualCircuitPublicPrefixes
Back to Collection Items
<?php
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
// For versions of Chilkat < 10.0.0, use new COM('Chilkat_9_5_0.Chilkat.Http')
$http = new COM("Chilkat.Http");
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "publicPrefixes": [
// {
// "value": "<Error: Too many levels of nesting to fake this schema>"
// },
// {
// "value": "<Error: Too many levels of nesting to fake this schema>"
// }
// ]
// }
// For versions of Chilkat < 10.0.0, use new COM('Chilkat_9_5_0.Chilkat.JsonObject')
$json = new COM("Chilkat.JsonObject");
$json->UpdateString('publicPrefixes[0].value','<Error: Too many levels of nesting to fake this schema>');
$json->UpdateString('publicPrefixes[1].value','<Error: Too many levels of nesting to fake this schema>');
$http->SetRequestHeader('Content-Type','application/json');
$http->SetRequestHeader('x-content-sha256','{{content_sha256}}');
$http->SetRequestHeader('Authorization','{{signature}}');
$http->SetRequestHeader('Date','{{date}}');
// resp is a Chilkat.HttpResponse
$resp = $http->PostJson3('https://iaas.{{region}}.oraclecloud.com/20160918/virtualCircuits/:virtualCircuitId/actions/bulkAddPublicPrefixes','application/json',$json);
if ($http->LastMethodSuccess == 0) {
print $http->LastErrorText . "\n";
exit;
}
$respStatusCode = $resp->StatusCode;
print 'Response Status Code = ' . $respStatusCode . "\n";
if ($respStatusCode != 204) {
print 'Response Header:' . "\n";
print $resp->Header . "\n";
print 'Response Body:' . "\n";
print $resp->BodyStr . "\n";
print 'Failed.' . "\n";
exit;
}
print 'Success.' . "\n";
?>
Curl Command
curl -X POST
-H "Content-Type: application/json"
-H "Date: {{date}}"
-H "Authorization: {{signature}}"
-H "x-content-sha256: {{content_sha256}}"
-d '{
"publicPrefixes": [
{
"value": "<Error: Too many levels of nesting to fake this schema>"
},
{
"value": "<Error: Too many levels of nesting to fake this schema>"
}
]
}'
https://iaas.{{region}}.oraclecloud.com/20160918/virtualCircuits/:virtualCircuitId/actions/bulkAddPublicPrefixes
Postman Collection Item JSON
{
"name": "BulkAddVirtualCircuitPublicPrefixes",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Date",
"value": "{{date}}",
"description": "(Required) Current Date",
"type": "text"
},
{
"key": "Authorization",
"value": "{{signature}}",
"description": "(Required) Signature Authentication on Authorization header",
"type": "text"
},
{
"key": "x-content-sha256",
"value": "{{content_sha256}}",
"description": "(Required) Content sha256 for POST, PUT and PATCH operations",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"publicPrefixes\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/virtualCircuits/:virtualCircuitId/actions/bulkAddPublicPrefixes",
"host": [
"{{baseUrl}}"
],
"path": [
"virtualCircuits",
":virtualCircuitId",
"actions",
"bulkAddPublicPrefixes"
],
"variable": [
{
"key": "virtualCircuitId",
"value": "amet ut",
"description": "(Required) The [OCID](/Content/General/Concepts/identifiers.htm) of the virtual circuit."
}
]
},
"description": "Adds one or more customer public IP prefixes to the specified public virtual circuit.\nUse this operation (and not [UpdateVirtualCircuit](#/en/iaas/latest/VirtualCircuit/UpdateVirtualCircuit))\nto add prefixes to the virtual circuit. Oracle must verify the customer's ownership\nof each prefix before traffic for that prefix will flow across the virtual circuit.\n"
},
"response": [
{
"name": "Addition of public prefixes accepted.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"publicPrefixes\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/virtualCircuits/:virtualCircuitId/actions/bulkAddPublicPrefixes",
"host": [
"{{baseUrl}}"
],
"path": [
"virtualCircuits",
":virtualCircuitId",
"actions",
"bulkAddPublicPrefixes"
],
"variable": [
{
"key": "virtualCircuitId"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Bad Request",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"publicPrefixes\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/virtualCircuits/:virtualCircuitId/actions/bulkAddPublicPrefixes",
"host": [
"{{baseUrl}}"
],
"path": [
"virtualCircuits",
":virtualCircuitId",
"actions",
"bulkAddPublicPrefixes"
],
"variable": [
{
"key": "virtualCircuitId"
}
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "opc-request-id",
"value": "officia sed",
"description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
},
{
"name": "Unauthorized",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"publicPrefixes\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/virtualCircuits/:virtualCircuitId/actions/bulkAddPublicPrefixes",
"host": [
"{{baseUrl}}"
],
"path": [
"virtualCircuits",
":virtualCircuitId",
"actions",
"bulkAddPublicPrefixes"
],
"variable": [
{
"key": "virtualCircuitId"
}
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "opc-request-id",
"value": "officia sed",
"description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
},
{
"name": "Not Found",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"publicPrefixes\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/virtualCircuits/:virtualCircuitId/actions/bulkAddPublicPrefixes",
"host": [
"{{baseUrl}}"
],
"path": [
"virtualCircuits",
":virtualCircuitId",
"actions",
"bulkAddPublicPrefixes"
],
"variable": [
{
"key": "virtualCircuitId"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "opc-request-id",
"value": "officia sed",
"description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
},
{
"name": "Internal Server Error",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"publicPrefixes\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/virtualCircuits/:virtualCircuitId/actions/bulkAddPublicPrefixes",
"host": [
"{{baseUrl}}"
],
"path": [
"virtualCircuits",
":virtualCircuitId",
"actions",
"bulkAddPublicPrefixes"
],
"variable": [
{
"key": "virtualCircuitId"
}
]
}
},
"status": "Internal Server Error",
"code": 500,
"_postman_previewlanguage": "json",
"header": [
{
"key": "opc-request-id",
"value": "officia sed",
"description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
},
{
"name": "An error has occurred.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"publicPrefixes\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/virtualCircuits/:virtualCircuitId/actions/bulkAddPublicPrefixes",
"host": [
"{{baseUrl}}"
],
"path": [
"virtualCircuits",
":virtualCircuitId",
"actions",
"bulkAddPublicPrefixes"
],
"variable": [
{
"key": "virtualCircuitId"
}
]
}
},
"status": "Internal Server Error",
"code": 500,
"_postman_previewlanguage": "json",
"header": [
{
"key": "opc-request-id",
"value": "officia sed",
"description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
}
]
}