London AvailabilityDomain could not be inferred from the Request - oracle-cloud-infrastructure

I am pretty sure this is something trivial, but I am a bit stuck with this.
I am trying to create an instance in Oracle Cloud in uk-london-1 region via OCI CLI tool.
I am getting
"code": "InvalidParameter",
"message": "AvailabilityDomain could not be inferred from the Request",
The command I am trying to use:
oci compute instance launch --availability-domain lMrS:UK-LONDON-1-AD-1 --compartment-id <myid> --shape VM.Standard.E2.1.Micro --subnet-id <subnetid> --image-id Canonical-Ubuntu-22.04-2022.06.16-0
I got the list of AD's via CLI
~$ oci iam availability-domain list
{
"data": [
{
"compartment-id": "ocid1.tenancy.oc1..###",
"id": "ocid1.availabilitydomain.oc1..###",
"name": "lMrS:UK-LONDON-1-AD-1"
},
{
"compartment-id": "ocid1.tenancy.oc1..###",
"id": "ocid1.availabilitydomain.oc1..###",
"name": "lMrS:UK-LONDON-1-AD-2"
},
{
"compartment-id": "ocid1.tenancy.oc1..###",
"id": "ocid1.availabilitydomain.oc1..###",
"name": "lMrS:UK-LONDON-1-AD-3"
}
]
}
And it is the same list of AD names I see in the Web UI.
Also I have similar error when trying to follow Oracle Cloud "Terraform: Create a Compute Instance" tutorial.
Any help will be appreciated!

Thanks to #urawesome, my compartment-id was wrong and the error returned is a bit misleading as well.
I used actual Compartment name from web UI, when it should have been ocid1.tenancy.### Mainly focused on availability-domain thinking that other parameters will throw different errors if they are invalid.
Correct compartment-id aka tenancy-id solved the issue.
Thanks!

Related

Autodesk Construction Cloud API unavailable endpoints

Our team is working with Autodesk Construction Cloud and it's Docs module quite heavily. Because of that we're trying to develop some internal tools which would automate some work that they do, mostly around copying files.
In ACC Docs you can easily copy files from one folder to another. From our investigation it looks like the ACC internally uses an endpoint like this to copy the files:
https://developer.api.autodesk.com/dm/v3/projects/{{projectId}}/documents:copy?targetFolder={{targetFolder}}
By using the authentication token from ACC requests (obtained from the browser), we can easily use this call from Postman or even an AWS Lambda function. But when we're using the auth tokens obtained from 3-legged auth process as described in the documentation, the same API call fails.
Is it even possible right now to obtain an auth token which works with that endpoint for copying ACC Docs files? Or is this not available right now as this API is still not really "public"?
Happy New Year!
Those APIs are internal APIs. Please do not try to use them. even if it may work, you would use it on your own risk..
Regarding with copy files files from one folder to the other, you can use the public API. After you get the version urn of the original file, call the endpoint below with the parameter
POST https://developer.api.autodesk.com/data/v1/projects/{PROJECT_ID}/items?copyFrom=urn%3Aadsk.wipprod%3Afs.file%3Avf.rH_L4XJsTmeiYA4ixCVNAA%3Fversion%3D1
with the payload, in which specify the target folder.
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "items",
"relationships": {
"tip":{
"data":{
"type":"versions",
"id":"1"
}
},
"parent": {
"data": {
"type": "folders",
"id": "urn:adsk.wipprod:fs.folder:co.0xaYa2rVTJuFiz7rxLCOQQ"
//!<<< The folder we want to put this file
}
}
}
},
"included":[
{
"type":"versions",
"id":"1",
"attributes":{
"name":"rac_basic_sample_project.rvt" //!<<< Version name
}
}
]
}

Integration from CRM to Team Foundation Server 2018

We have CRM where customers create tickets (change requests, incidents...).
From developer team side we have Team Foundation Server 2018.
To speed up process we would like to automatize entire thing. So, when customer create ticket, to automatic create TFS User Story.
We developed code to take, every time when ticket is created, data and put into JSON file. (will attach code in Github and share a link)
But now, I just need info, is someone have an idea, how JSON file should looks like which need to post to TFS in order to create new user story.
{
"fields": {
"System.WorkItemType": "User Story",
"System.AreaPath": "EJ2TFS",
"System.TeamProject": "EJ2TFS",
"System.IterationPath": "EJ2TFS",
"System.State": "New",
"System.Reason": "New",
"Microsoft.VSTS.Common.StateChangeDate": "2019-01-01T00:00:00Z",
"System.ChangedBy": "Doe, John <firm\\doej>",
"System.CreatedBy": "Doe, John <firm\\doej>",
"System.Title": "Sample task created by POST API",
"System.Discussion":"test1",
"Microsoft.VSTS.Common.StateChangeDate": "2019-01-31T14:00:00",
"Microsoft.VSTS.Common.Priority": 2,
"Microsoft.VSTS.Common.ValueArea": "Business"
}
}
And error is:
{
"$id": "1",
"innerException": null,
"message": "The request indicated a Content-Type of \"text/plain\" for method type \"POST\" which is not supported. Valid content types for this method are: application/json-patch+json.",
"typeName": "Microsoft.VisualStudio.Services.WebApi.VssRequestContentTypeNotSupportedException, Microsoft.VisualStudio.Services.WebApi",
"typeKey": "VssRequestContentTypeNotSupportedException",
"errorCode": 0,
"eventId": 3000
}
Looks like your payload need a makeover. I referred couple of code samples & sharing this snippet. (Pls test this, I didn’t get a chance to test it)
POST https://dev.azure.com/fabrikam/{project}/_apis/wit/workitems/$User Story?api-version=5.0
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "My first user story"
}
]
MS documentation example
GitHub sample

How can I connecting NanoPool.org API to Telegram by Json

I'm using cryptocurrency mining website NanoPool.org
I should check the Data of this site for example Hashrate, workers and other things like that
I want to know how can I connect this site to my telegram.
Actually I don't know nothing about that, the only thing I aware about is that, the site have API with json but I searched a lot on Google couldn't find accurate training about that.
This is API link of this website.
Would you please help me how can I do that?
Thanks
User Data example code:
{
"account": "4AHBwkKjWT2jHv83V6ahZXUWCYe9JmyNygQJ7ueQUMhHJrJQJrWnYHHUMuaZhCGSnvKTjodddyxqwdz8y2o7aKRV6C1xntS",
"unconfirmed_balance": "0.36812920",
"balance": "5.87838746",
"hashrate": "2767380.0",
"avgHashrate": {
"h1": "2777915.0",
"h3": "2773365.0",
"h6": "2726529.2",
"h12": "2648470.4",
"h24": "2764918.3"
},
"workers": [
{
"id": "is",
"hashrate": "1861860.0",
"lastShare": 1505534231,
"rating": 322640212,
"avg_h1": "1855980.0",
"avg_h3": "1860296.7",
"avg_h6": "1858237.5",
"avg_h12": "1854944.6",
"avg_h24": "1854664.6"
},
{
"id": "china",
"hashrate": "905520.0",
"lastShare": 1505534231,
"rating": 118148712,
"avg_h1": "921935.0",
"avg_h3": "913068.3",
"avg_h6": "868291.7",
"avg_h12": "793525.8",
"avg_h24": "910253.8"
}
]
}
You can implement it with use of python json, telepot and requests libs
1. Receive json file from nanopool api via requests lib
2. Parse it via json lib
3. Create bot via botfather
4. Send it via telepot library as message to yourself from created bot

AWS dynamo DB service Proxy

I followed this tutorial to implement DynamoDB endpoint proxy service via API Gateway:
https://aws.amazon.com/blogs/compute/using-amazon-api-gateway-as-a-proxy-for-dynamodb/
I manage to implement the PutItem and Query actions, but when I try to make a DeleteItem action i get the following error:
"message": "The provided key element does not match the schema"
That's my Get Method Integration:
{
"TableName": "Notes",
"Key": {
"myID": {
"S": "$input.params('ID')"
}
}
}
where myID is the primary key,
Any help will be greatly appreciated!

Malformed JSON response when GETting /me/memberOf (Microsoft Graph)

I'm trying to set up a sign-on process for an internal company web app using the Azure AD and Microsoft Graph. I want to manage security groups in the AD, so when a user signs in via OAuth, I'm doing a GET request to https://graph.microsoft.com/v1.0/me/memberOf to see which groups the signed-in user is in. The user has the appropriate scopes to see this information, and it works in the Graph Explorer, but when I make the call in my PHP application, I get a malformed JSON response:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
"value": [{
"#odata.type": "#microsoft.graph.group",
"objectType": "Group",
"objectId": "blahblah2",
"deletionTimestamp": null,
"description": "Users who have access to my web app's administration",
"dirSyncEnabled": null,
"displayName": "Web App Administrators",
"lastDirSyncTime": null,
"mail": null,
"mailNickname": "blahblah2",
"mailEnabled": false,
"onPremisesSecurityIdentifier": null {
"error": {
"code": "InternalServerError",
"message": "Unsupported extension property type.",
"innerError": {
"request-id": "blahblah3",
"date": "2016-02-29T09:42:18"
}
}
}
...and that's all I get!
The documentation at https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#GroupEntity says that this onPremisesSecurityIdentifier field is something to do with on-premesis sync, but i've never used that.
Your request had api-version query parameter appended (i.e. /v1.0/me/memberOf?api-version=1.6). Please remove that query parameter. Microsoft Graph identifies the API version by the first segment in the URL path, e.g. https://graph.microsoft.com/v1.0/me/memberOf or https://graph.microsoft.com/beta/me/memberOf