Cannot create Virtual IP using the SoftLayer API - api

When using the API to place an order for a VIP, it is failing with a non intuitive error message. Please see the following REST API call JSON and the ensuing error:
JSON:
{
"loadBalancer": {
"name": "lbName_TEST",
"id" : 123,
"type": "HTTP",
"sourcePort": 80,
"virtualIpAddress": "123.123.123.123"
}
}
REST API URL USED:
https://user.name:longid4235234532#api.softlayer.com/rest/v3/SoftLayer_Network_Application_Delivery_Controller/15293/createLiveLoadBalancer.json
{
"error": "Invalid port supplied.",
"code": "SoftLayer_Exception_Public"
}
The question that arises is this. We are trying to script the ordering of a VPX Netscaler and the addition of all related configurations to the created VPX, are we doing something out of order?

Related to create the loadBalancer the JSON is wrong, try this JSON:
{
"parameters": [
{
"name": "lbName_TEST",
"type": "HTTP",
"sourcePort": 80,
"virtualIpAddress": "123.123.123.123",
"loadBalancingMethod": "pi"
}
]
}
Regards

To order a device or service, you need to use the SoftLayer_Product_Order::placeOrder method. here an example to order a NetScaler
URL: https://api.softlayer.com/rest/v3/SoftLayer_Product_Order/placeOrder
Method: POST
PAYLOAD: {
"parameters": [
{
"packageId": 192,
"location": 265592,
"prices": [
{
"id": 22315,
"complexType": "SoftLayer_Product_Item_Price"
},
{
"id": 17238,
"complexType": "SoftLayer_Product_Item_Price"
}
],
"complexType": "SoftLayer_Container_Product_Order_Network_Application_Delivery_Controller"
}
]
}
The price 22315 is for a "Citrix NetScaler VPX 10.1 10Mbps Standard" and the 17238 is for "2 Static Public IP Addresses"
To get all the prices use the http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getItems method

Related

Facebook ads custom audience Data is missing or does not match schema error

i was building a integration with the facebook ads audience API, and according the documentation the request must be created like this:
POST - https://graph.facebook.com/v15.0/<MY_CUSTOM_AUDIENCE_ID>/users?access_token=<MY_ACCESS_TOKEN>
{
"session":{
"session_id":1,
"batch_seq":1,
"last_batch_flag":true,
"estimated_num_total":1
},
"payload":{
"schema":[
"FN"
],
"data":
[
"8b1ebea129cee0d2ca86be6706cd2dfcf79aaaea259fd0c311bdbf2a192be148"
]
}
}
Using the previus example a received a error 400:
{
"error": {
"message": "(#100) Data is missing or does not match schema",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "AqrLd9uIw0D4BBFtHF33bdU"
}
}
For do this i used this documentation https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences#hash
Anyone has use this before?
Your schema field type is array but array use form multi-key qualification.
Change it to string: schema: 'FN'
In docs you can see all formats.
This payload with multi keys work for me:
{
"session": {
"session_id": 123,
"batch_seq": 1,
"last_batch_flag": true
},
"payload": {
"schema": [
"EMAIL",
"PHONE",
"FN"
],
"data": [
["EMAIL_HASH", "PHONE_HASH", "FN_HASH"]
]
}
}

The request includes at least one invalid\/malformed connection photo id

I'm using Google StreetView Publish API to connect photos in a virtual tour and to some external photos on Google StreetView such as a road.
This is the API I use:
https://developers.google.com/streetview/publish/reference/rest/v1/photo/update
And this is the body of the request:
{
"pose": {
"heading": 26,
"latLngPair": {
"latitude": 47.707604844777,
"longitude": -124.41849471719
}
},
"places": [
{
"place_id": "ChIJvcvraDvfjVQR45a-VRk0lGs"
}
],
"connections": [
{
"target": {
"id": "CAoSLEFGMVFpcE5fWGtUZTFWV3dxRm9tOEFlRHVmYVdvTmdDR2NueVZ0dzhid0ZX"
}
},
{
"target": {
"id": "rQfq6hLfyFVfC0V43rrWDw"
}
}
],
"captureTime": {
"seconds": "1653027016"
}
}
But I'm getting this error message when I'm trying to add external panorama ID ({"target":{"id": "rQfq6hLfyFVfC0V43rrWDw"}} to the connections array.
{
"error": {
"code": 400,
"message": "The request includes at least one invalid\/malformed connection photo id.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com\/google.rpc.ErrorInfo",
"metadata": {
"EXTERNAL_MESSAGE": "The request includes at least one invalid\/malformed connection photo id."
}
}
]
}
}
Does Google let to connect your panoramas to the Google StreetViews panoramas such as street photos, etc? Or what I was doing wrong? Thank you in advance
You can not link your panoramas directly to Google Street View panoramas.
For a while, Google connected the tours automatically, if they were in a certain range. They stopped doing this and undid those connections, so at the moment both exist side by side on the same map.

Agora cloud recording is not saving file in S3 when streaming from android

I have already viewed this question
I followed the procedure, first called acquire then start then stop
I followed the procedure , first called acquire then start then stop
Here is my acquire call
https://api.agora.io/v1/apps/{{APPID}}/cloud_recording/acquire
Request body
{
"cname": "{{AccessChannel}}",
"uid": "{{RecordingUID}}",
"clientRequest":{
}
}
The response
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfzZ8g-RNe4wP9vsFnBhU785sHbxN0_dI8MVBqLWrCy7TCUo4U3XXne-2hA7expaSg-NgpZ5PcnFK-IrNSvmFNJqL4PGS9hw2q7lDYEtJH_0VgBG4Qdsg2TofWuF2DW7IMAt8NYBp9Hh_06d1K3pIcMJFPUWvfV7fInPDrecYuDmZdiRS9AYydjQlHa6jb51S0sKXzTVYELCJZAXP-ALS_whAh_ojFeltKLKzOC9iYodyAAwq4QnclbL3LKvBeVtCEfS9WjyYzyHDhCngJ-JrIwW"
}
Then I call start
URL : https://api.agora.io/v1/apps/{{APPID}}/cloud_recording/resourceid/{{resourceId}}/mode/mix/start
Body:
{
"cname":"{{AccessChannel}}",
"uid":"{{RecordingUID}}",
"clientRequest":{
"recordingConfig":{
"maxIdleTime":300,
"streamTypes":2,
"channelType":1,
"videoStreamType":0,
"transcodingConfig":{
"height":640,
"width":360,
"bitrate":500,
"fps":15,
"mixedVideoLayout":1,
"backgroundColor":"#FF0000"
},
"subscribeVideoUids":[
"123",
"456"
],
"subscribeAudioUids":[
"123",
"456"
],
"subscribeUidGroup":0
},
"storageConfig":{
"vendor":1,
"region":0,
"bucket":"{{Bucket}}",
"accessKey":"{{AccessKey}}",
"secretKey":"{{SecretKey}}",
"fileNamePrefix":[
"directory1",
"directory2"
]
},
"recordingFileConfig":{
"avFileType":[
"hls"
]
}
}
}
Response
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfzZ8g-RNe4wP9vsFnBhU785sHbxN0_dI8MVBqLWrCy7TCUo4U3XXne-2hA7expaSg-NgpZ5PcnFK-IrNSvmFNJqL4PGS9hw2q7lDYEtJH_0VgBG4Qdsg2TofWuF2DW7IMAt8NYBp9Hh_06d1K3pIcMJFPUWvfV7fInPDrecYuDmZdiRS9AYydjQlHa6jb51S0sKXzTVYELCJZAXP-ALS_whAh_ojFeltKLKzOC9iYodyAAwq4QnclbL3LKvBeVtCEfS9WjyYzyHDhCngJ-JrIwW",
"sid": "6068aec4fd4fc47b623bceaf1f2c8f6b"
}
And finally I called stop
URL: https://api.agora.io/v1/apps/{{APPID}}/cloud_recording/resourceid/{{resourceId}}/sid/{{sid}}/mode/mix/stop
Body:
{
"cname": "{{AccessChannel}}",
"uid": "{{RecordingUID}}",
"clientRequest": {}
}
And the response is
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfzZ8g-RNe4wP9vsFnBhU785sHbxN0_dI8MVBqLWrCy7TCUo4U3XXne-2hA7expaSg-NgpZ5PcnFK-IrNSvmFNJqL4PGS9hw2q7lDYEtJH_0VgBG4Qdsg2TofWuF2DW7IMAt8NYBp9Hh_06d1K3pIcMJFPUWvfV7fInPDrecYuDmZdiRS9AYydjQlHa6jb51S0sKXzTVYELCJZAXP-ALS_whAh_ojFeltKLKzOC9iYodyAAwq4QnclbL3LKvBeVtCEfS9WjyYzyHDhCngJ-JrIwW",
"sid": "6068aec4fd4fc47b623bceaf1f2c8f6b",
"code": 435
}
I am not sure what did I do wrong ?
My streaming is running on a android device , only one broadcaster no audience
And I called the API from postman
I have double checked every parameter
Please make sure you are passing the authentication token in the request body of start API.
Here is sample
{
"cname":"{{AccessChannel}}",
"uid":"{{RecordingUID}}",
"clientRequest":{
"token": "<place token here>",
"recordingConfig":{
"maxIdleTime":300,
"streamTypes":2,
"channelType":1,
"videoStreamType":0,
"transcodingConfig":{
"height":640,
"width":360,
"bitrate":500,
"fps":15,
"mixedVideoLayout":1,
"backgroundColor":"#FF0000"
},
"subscribeVideoUids":[
"123",
"456"
],
"subscribeAudioUids":[
"123",
"456"
],
"subscribeUidGroup":0
},
"storageConfig":{
"vendor":1,
"region":0,
"bucket":"{{Bucket}}",
"accessKey":"{{AccessKey}}",
"secretKey":"{{SecretKey}}",
"fileNamePrefix":[
"directory1",
"directory2"
]
},
"recordingFileConfig":{
"avFileType":[
"hls"
]
}
}
}

GraphJSON serialization in Gremlin.Net

I'm trying to query the TinkerPop server (hosted inside docker container) via CosmosDB client library, which uses under the hood Gremlin.Net. So I managed to connect it and insert the data, here's intercepted WebSocket request:
!application/vnd.gremlin-v1.0+json{
"requestId": "b64bd2eb-46c3-4095-9eef-768bca2a14ed",
"op": "eval",
"processor": "",
"args": {
"gremlin": "g.addV(\"User\").property(\"UserId\",2).property(\"CustomerId\",1)"
}
}
The response:
{
"requestId": "b64bd2eb-46c3-4095-9eef-768bca2a14ed",
"status": {
"message": "",
"code": 200,
"attributes": {
"host": "/172.19.0.1:38848"
}
},
"result": {
"data": [
{
"id": 0,
"label": "User",
"type": "vertex",
"properties": {}
}
],
"meta": {}
}
}
Problem is that I see those properties when I'm connected via gremlin console
gremlin> g.V().hasLabel("User").has("CustomerId",1).has("UserId",2).limit(1).valueMap()
==>{UserId=[2], CustomerId=[1]}
Also, I'm able to query the TinkerPop server with Gremlin.Net:
!application/vnd.gremlin-v1.0+json{
"requestId": "de35909f-4bc1-4aae-aa5f-28361b3c0933",
"op": "eval",
"processor": "",
"args": {
"gremlin": "g.V().hasLabel(\"User\").has(\"CustomerId\",1).has(\"UserId\",2).limit(1)"
}
}
But it returns a payload with zero-valued ID and without any properties included:
{
"requestId": "de35909f-4bc1-4aae-aa5f-28361b3c0933",
"status": {
"message": "",
"code": 200,
"attributes": {
"host": "/172.19.0.1:38858"
}
},
"result": {
"data": [
{
"id": 0,
"label": "User",
"type": "vertex",
"properties": {}
}
],
"meta": {}
}
}
Tried to swap between GraphSON v1, v2, v3 with no luck. Documentation says that script serializers should include all the properties. Do I have to tweak the config somehow to make this work and return properties?
So it seems that with a version of 3.4 of the Gremlin server ReferenceElementStrategy
was added by default to traversals, to preserve compatibility between binary and script serializers. In our case we wanted to mimic the behavior of the CosmosDB, so to adjust and receive desired behavior just remove the strategy from init script (in our case it was empty-sample.groovy
globals << [g : graph.traversal().withStrategies(ReferenceElementStrategy.instance())]
to
globals << [g : graph.traversal()]

AWS API Gateway: How to combine multiple Method Request params into a single Integration Request param

I'd like to use API Gateway as a proxy to S3. The bucket is keyed by a composite key made up of two parts like this: [userId]-[documentId].
UserId comes to API Gateway as a path parameter, documentId comes in as a request parameter, for example: [gateway-url]/user1?documentId=doc1
How can I combine the two so that the s3 lookup URL has the following format: https://[bucket-url]/user1-doc1?
Thank you.
Setup your Method Request to accept the path param {userid} and query param {docid}.
Setup your Integration Request to accept both method.request.querystring.docid and method.request.path.userid as URL path params.
Finally, setup your integration endpoint URL as https://your-url/{userid}-{docid}.
A swagger snippet for this is as follows-
"paths": {
"/concat-params/{userid}": {
"get": {
"parameters": [
{
"name": "userid",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "docid",
"in": "query",
"required": false,
"type": "string"
}
],
"responses": {...},
"x-amazon-apigateway-integration": {
"responses": {...},
"requestParameters": {
"integration.request.path.userid":"method.request.path.userid",
"integration.request.path.docid":"method.request.querystring.docid"
},
"uri": "https:.../{userid}-{docid}",
...
}
}
}
Hope this helps,
Ritisha.