Duplicate request to OData v2 service - sapui5

we have configured a descriptor (manifest.json) for our frontend application that is using an OData service as a data source with the following configurations:
"": {
"dataSource": "mainService",
"preload": true,
"settings": {
"defaultBindingMode": "TwoWay",
"defaultCountMode": "Inline",
"refreshAfterChange": false,
"metadataUrlParams": {
"value-list": "none"
},
"useBatch": false
}
}
For some reason sporadically when the page is loading there are 2 identical OData requests and the first is immediately canceled. Have you observed similar behavior and have a solution for this? Thanks in advance!

Related

Azure DevOps OAuth organization policies API

is there a way to know via API what is the organization policy for 3rd party OAuth requests?
i want to know if i should ask my user to authenticate with his credentials or generate PAT
is there a way to know via API what is the organization policy for 3rd
party OAuth requests?
You can use this api which I fetched from F12:
Get https://dev.azure.com/{YourOrgName}/_settings/organizationPolicy?__rt=fps&__ver=2
The response would contain the info about Application Connection Policies:
"ms.vss-admin-web.organization-policies-data-provider": {
"policies": {
"applicationConnection": [
{
"policy": {
"name": "Policy.DisallowOAuthAuthentication",
"value": false,
"effectiveValue": true,
"parentPolicy": {
"name": "Policy.DisallowOAuthAuthentication",
"value": false,
"effectiveValue": true,
"isValueUndefined": true
}
},
"learnMoreLink": "https://aka.ms/vstspolicyoauth",
"description": "Third-party application access via OAuth",
"applicableServiceHost": 1
},
{
"policy": {
"name": "Policy.DisallowSecureShell",
"value": false,
"effectiveValue": true,
"isValueUndefined": true,
"parentPolicy": {
"name": "Policy.DisallowSecureShell",
"value": false,
"effectiveValue": true,
"isValueUndefined": true
}
},
"learnMoreLink": "https://aka.ms/vstspolicyssh",
"description": "SSH authentication",
"applicableServiceHost": 1
}
]...
The effectiveValue(not value node) node under corresponding policy node should represent whether you enable/disable the policies above in your pic. E.g: The effectiveValue node under first policy node would be false if the Third-party application access via OAuth is disabled.

Unable to get Taleo entity picklist values

I am working with Rest API's of Taleo Business edition. I am unable to get picklist values using Discovery API. For example if i try to get picklist values for 'status'field of Requisition using Rest API https://ldn.tbe.taleo.net/ldn01/ats/api/v1/object/displayfield/REQU/status
then in response i get blank value for 'lookupValues'
{
"response": {
"displayfield": {
"status": {
"entityType": "REQU",
"displayFieldName": "Status",
"externalName": "status",
"dataType": "Picklist",
"description": "",
"maxLength": -1,
"sortedAscending": false,
"selectFirstAsDefault": false,
"fieldType": "L",
"lookupValues": []
}
}
},
"status": {
"success": true,
"detail": {}
}
}
Any idea what i am missing ?
Taleo is weird. For some values it returns picklist e.g. https://ldn.tbe.taleo.net/ldn01/ats/api/v1/object/displayfield/WORK/role but for some, the similar API returns blank response.

IBM Function returning weird data back when calling REST API Endpoint

I have an IBM Cloud Function like:
return {'body': csv_output.getvalue(),
'headers': {'Content-Type': 'text/csv',
'Content-Disposition': 'attachment;filename=dat.csv'}}
When called a public API endpoint it returns a csv file with right data.
But when I use postman to make a REST API endpoint call I get a weird result like:
{
"annotations": [
{
"key": "exec",
"value": "python:3.7"
},
{
"key": "web-export",
"value": true
},
{
"key": "final",
"value": true
},
{
"key": "raw-http",
"value": true
}
],
"exec": {
"kind": "python:3.7",
"code": "import
Can someone please tell me what am I doing wrong? Seems like I am getting code back rather than invoking the function.
It looks like you are using POSTMAN to return actions details (via the platform API), rather than invoking as a web action.
The HTTP endpoint for an action is https://{APIHOST}/api/v1/namespaces/_/actions/<ACTION_NAME>.
The HTTP endpoint for invoking an action as a web action is https://{APIHOST}/api/v1/web/{QUALIFIED ACTION NAME}.{EXT}.

How do I add SAP Gateway services to an existing SAP WEB IDE Project?

I've imported a SAP WEB IDE project from SAP Build....
All looks great, but now I need to add in my Gateway services to handle oData etc.
I've setup my SAP Cloud Connector to and Destinations.
How specifically do I add these as all tutorials seems to start by including the service as part of a template.
You have to do some steps to make this work:
implement the service definition in your manifest.json file:
"sap.app": {
[...],
"dataSources": {
"mainService": {
"uri": "/your/path/to/service",
"type": "OData",
"settings": {
"odataVersion": "2.0",
"localUri": "localService/metadata.xml"
}
}
},
[...]
},
implement the model definition in your manifest.json file:
"models": {
[...],
"": {
"dataSource": "mainService",
"settings": {
"metadataUrlParams": {
"sap-documentation": "heading"
},
"defaultBindingMode": "TwoWay"
}
}
},
You can go to the New>oData service menu from the project and create it that way too.

Azure Automation Registration Endpoint is corrupted when used to pull DSC configuration

For some reason, I keep getting these weird issues.....
In this case, I have a Key and Endpoint URL for the Automation Account stored as Secrets in a KeyVault (I don't know of a away to extract it natively from Automation Account using ARM).
I can extract these values perfectly and they they are published to the Template that runs a PowerShell extension to pull a DSC Configuration.
For example as seen as an Input deploying the Template:
"RegistrationUrl":"https://ase-agentservice-prod-1.azure-automation.net/accounts/e0799801-a8da-8934-b0f3-9a43191dd7e6"
However, I receive the following error (note the Url in the Error with 3 forward slashes)
"code": "VMExtensionProvisioningError",
"message": "VM has reported a failure when processing extension 'dscLcm'.
Error message: "DSC Configuration 'ConfigureLCMforAAPull' completed with error(s). Following are the first few: The attempt to 'get an action' for AgentId 11A5A267-6D00-11E7-B07F-000D3AE0FB1B from server URL https://ase-agentservice-prod-1.azure-automation.net///accounts/e0799801-a8da-8934-b0f3-9a43191dd7e6/Nodes(AgentId='11A5A267-6D00-11E7-B07F-000D3AE0FB1B')/GetDscAction failed with server error 'ResourceNotFound(404)'.
For further details see the server error message below or the DSC debug event log with ID 4339.
ServerErrorMessage:- 'No NodeConfiguration was found for the agent.'\"."
The Endpoint Url is passed as a Secure String. I tried passing it a normal string - Same problem.
The Key and Endpoint are feed into the Template as Parameters:
"dscKeySecret": {
"type": "securestring",
"metadata": {
"description": "Key for PowerShell DSC Configuration."
}
},
"dscUrlSecret": {
"type": "securestring",
"metadata": {
"description": "Url for PowerShell DSC Configuration."
}
},
These values are used to create a parameter to be passed to the next template that runs the VM Extension.
"extn-settings": {
"value": {
"configuration": {
"url": "[concat(variables('urls').dscScripts, '/', 'lcm-aa-pull', '/', 'lcm-aa-pull', '.zip')]",
"script": "[concat('lcm-aa-pull', '.ps1')]",
"function": "ConfigureLCMforAAPull"
},
"configurationArguments": {
"registrationKey": {
"username": "dsckeySecret",
"password": "[parameters('dscKeySecret')]"
},
"registrationUrl": "[parameters('dscUrlSecret')]",
"configurationMode": "ApplyAndMonitor",
"configurationModeFrequencyMins": 15,
"domain": "[variables('names').domain]",
"name": "dscLcm",
"nodeConfigurationName": "[variables('names').config.ad]",
"rebootNodeIfNeeded": true,
"refreshFrequencyMins": 30
},
"protectedSettings": null,
}
}
The next template receives the Parameters and used in the Properties of the VM's Resources section:
"properties": {
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.22",
"autoUpgradeMinorVersion": true,
"settings": {
"configuration": "[parameters('extn-settings').configuration]",
"configurationArguments": "[parameters('extn-settings').configurationArguments]"
},
"protectedSettings": "[parameters('extn-settings').protectedSettings]"
}
So why is the Url being corrupted with the the first '/' being changed to '///'?
I don't why the Endpoint Url has 3 x '/', but that wasn't the issue.... I wish I found the issue before I posted this question...
I found the Node Configuration Name was wrong with a spelling mistake (hang head in shame)
Thanks anyway!