Using Google.Cloud.ArtifactRegistry.V1Beta2 with parent - Permission problem - google-artifact-registry

I wonder if anyone has used Google.Cloud.ArtifactRegistry.V1Beta2?
I am trying to create a console application with the api to list all Repositories in a project.
ListRepositoriesRequest request = new ListRepositoriesRequest
{
Parent = "",
PageSize = 1
};
var response = client.ListRepositories( request );
I have no indication what parent should be. The help just says "The name of the parent resource whose repositories will be listed". I have tried project name, project id but nothing works. I get the error "Permission denied" and I have full access as I am the owner of the project. Being lost what could be wrong, I suspect it could be the parent or does anyone has any idea where to look?

Sometimes the docs are not very clear but this one is very clear. If you look closer to the section HTTP request you will find
GET https://artifactregistry.googleapis.com/v1beta2/{parent=projects/*/locations/*}/repositories
So the parent is:
{parent=projects/*/locations/*} -> projects/*/locations/*
So, if you want to list repositories in us-central1 for example, your parent will be:
ListRepositoriesRequest request = new ListRepositoriesRequest
{
Parent = "projects/YOUR_PROJECT_ID/locations/us-central1",
PageSize = 1
};
var response = client.ListRepositories( request );
So my advice is to inspect very well the docs.

Related

How to get a working document preview link from MS Graph

I am trying to get a preview link for the useres recent documents over MS Graph. Unfortunately the link the endpoint returns does not work.
To get the informations about a file I first call GET https://graph.microsoft.com/beta/me/drive/recent. Then I copy the driveID and the id of a document from the parentReference property.
To get the preview link I use the Endpoint POST https://graph.microsoft.com/beta/drives/<DriveID>/items/<DocumentID>/preview
and this works fine. But when I click on the link I get the error "This item might not exist or is no longer avaiable". The document exists on the SharePoint, otherwise it would not appear under "recent documents". The url looks like this: https://www.onedrive.com/embed?webUrl=xyz.sharepoint.com/sites/nameOfTheSite/docLibName&id=sites/nameOfTheSite/DocLibName&embed=xxx&authToken=xxx
I expect the response of the /preview endpoint should return a working url. Do I have to make some configurations on O365?
Many Thanks
The embed link (preview) does not look valid in your example since id parameter refers to container (library): sites/nameOfTheSite/DocLibName. It is not supported, instead embed link should refer to a file
Most likely the issue is due to itemId:
https://graph.microsoft.com/beta/drives/<DriveID>/items/<DocumentID>/preview
^^^^^^^^^^^^
in your example it seems refers to a library instead of a file. Make sure the proper itemId is specified.
For example, https://graph.microsoft.com/v1.0/me/drive/recent endpoint returns the following payload:
{
"value" : {
//another properties are omitted for a clarity
//...
"remoteItem": {
"id": "01ECKZLCWSR7F76B64KZFL7I3QGZVPJELU"
//...
"parentReference": {
"driveId": "b!79yKq-2MdkSDnQ7_1Pf3FOkRyDCajpRIvqtA7UrsEO-vu3D_qkpaT50Y6CMcSmFv",
"driveType": "documentLibrary",
"id": "01ECKZLCV6Y2GOVW7725BZO354PWSELRRZ"
},
}
}
}
where
remoteItem.Id - corresponds to item id for a file
remoteItem.parentReference.driveId - corresponds to drive id
Dont get confused with remoteItem.parentReference.Id which corresponds
to item id of library

Open Route Service - LRM

ive been struggeling for awhile with this,
so i got two questions to ask.
First question:i cant change the profile on open route service.
my code is working when i put in the api-key in the code below.
var control;
function tests() {
var control = L.Routing.control({
waypoints: [
L.latLng(coords),
L.latLng(coords2)
],
router: new L.Routing.openrouteservice('Api-Key'),
}).addTo(map);
document.getElementById("RouteButton").onclick = tests;
};
But when i try changing the profile, it either doesnt change or get error messages.
The things i tried so far is.
router: new L.Routing.openrouteservice({api_key:'HIDDEN', profile:'footwalking'),
and
router: new L.Routing.openrouteservice('https:// api.openrouteservice.org /directions? & api_key = Hidden& profile = foot-walking'),
The first one works, but the profile doesnt change It is still using the driving-car default profile.
The Second one gives me a two error messages,
First error message is | Access to XMLHttpRequest at 'https://api.openrouteservice.org/directions?' from origin 'http://localhost:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. |
Second error message | corslite.js:87 GET https://api.openrouteservice.org/directions? 403 (Forbidden) |
both of the error messages gives off a long url which ive shorted down to https://api.openrouteservice.org/directions?.
The other Question i got is, how do i clear the map, so a previously drawn route gets removed when a new route is drawn. On the picture below you can see what happens at the moment when i request a second route, both the old and the new i shown.
two routes on the same map
Hope you guys can help.
open the L.Routing.OpenRouteService.js

Workday: Put_Customer returning an error

We are using Snaplogic to load records into workday. Currently, extracting customer records from the source and trying to load them into workday using the object Put_Customer of web service Revenue_Management.
I was getting the following error:
But I'm not getting any category information from the source. So, I tried putting the value for Customer_Category_Reference as 1. But I ended up getting the following error.
The documentation for workday is not helpful and this has been a blocker for me for some time now.
Any help will be appreciated.
Update:
Trying to get customer categories using the Get_Customer_Categories object of Revenue_Management web service using Snaplogic. But getting the following error:
Failure: Soap fault, Reason: Processing error occurred. The task submitted is not authorized., Resolution: Address SOAP fault message and retry
Unfortunately I don't have access to a tenant at this time to validate . However it is likely to work based in prior experience . Perhaps you could create a customer in Workday, through the GUI. Then do get customer API call. Note the category reference . Then, use that in your put customer call
If you look at the API documentation, you will find that Put_Customer accepts a WID in the Customer_WWS_Data object. If you search for "Customer Categories" in Workday, you will likely find the report of the same name. Just select the category that you want your newly loaded customers to default to (click on the magnifying class, then on the ellipsis, Integration Ids, View Ids). The Workday ID will appear at the top.
I have not used the Revenue Management API, but my code for creating a position reference in the Compensation API is probably very similar to what you need to do for the Customer Category reference:
public static Position_ElementObjectType getPositionReference(string WID) {
return new Position_ElementObjectType {
ID = new Position_ElementObjectIDType[] {
new Position_ElementObjectIDType {
type = "WID",
Value = WID
}
}
};
}

Add a subpanel record to a SugarCRM account through REST API

Question: How do I create a subpanel record through the SugarCRM rest api endpoint for accounts?
Steps taken so far:
I've added a new package called, "transactionHistory" with a module named, "InvoiceHistory" using the SugarCRM studio.
I added a One to Many relationship to the Accounts module using studio.
I'm using NetSuite to push new invoices to the new module's record via the subpanel "create" option. Here's the code I'm using:
function createSugarTransaction(transaction, token) {
var url = 'https://crm.techsoft3d.com/rest/v10/Accounts/' + transaction.customer;
var headers = {
"Content-Type": "application/json",
"OAuth-Token": token
};
var now = (new Date()).toISOString();
var body = {transactionHistory_InvoiceHistory:
{
create: [{
name: transaction.docId,
transaction_date_c: transaction.date,
invoice_status_c: transaction.status,
due_date_c: transaction.duedate,
total_amount_c: transaction.total,
amount_due_c: transaction.remaining,
start_date_c: transaction.startdate,
end_date_c: transaction.enddate
}]
}
};
var response = nlapiRequestURL(url, JSON.stringify(body), headers, 'PUT');
return response;
}
The transaction object has been validated and the json object within the create: [] array has matching sugar fields (key) with the corresponding transaction object values.
When making the API call to sugar I'm successfully authenticated and have access to the custom module and accounts - so no problem there. However, when the call is returned to response it's showing the following error:
{"error":"no_method","error_message":"Could not find a route with 1 elements"}
I'm unsure of what else is needed in order for the record to be created. According to sugar's help documentation and developer community this should work. I'm using the basic information provided by sugarcrm support portal:
http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.6/API/Web_Services/Examples/v10/module_POST/
According to other blog posts within the developer community, it should be as simple as adding the subpanel name, followed by an array of fields under the "create" object... similar to this:
var requestBody = { package_module:create[{name:value}]};
My initial thinking of what's wrong is:
1. my package_module name isn't correct, but I'm unable to find it anywhere within the applicaiton or help documentation.
2. the request body isn't formatted properly, even though it's structure was copied from this article https://developer.sugarcrm.com/2014/02/28/sugarcrm-cookbook2/
Any help would be appreciated.
try the createRelatedRecord api endpoint
type {sugarurl}/rest/v10/help to see a list of endpoints to look through, most of which have documentation and examples
https://crm.techsoft3d.com/rest/v10/help
your API url should have the name of the link (relationship) you want, in addition to the values in the POST payload
https://crm.techsoft3d.com/rest/v10/Accounts/{transaction.customer}/link/accounts_transactionhistory (or whatever your link's name is)
per the documentation for this endpoint, you just specify the field values in the payload
{
"first_name":"Bill",
"last_name":"Edwards"
}

facebookErrDomain code 3000

Today I received of one of my app users a complaint about an error code 3000.
I could not find any information about this error, nor do I have a clue what caused this error, because i have no tracking in the app. Insights is reporting errors on fql.multiquery
I know the queries are fine, only 1 person out of hundreds have this problem at current time.
Did you had this error already or do you know what exactly this error means? As far as I can see there us no official error code list anymore, and copied existing lists do not cover this response code.
Well, I managed to get a full error report from facebook:
Error Domain=facebookErrDomain Code=3000 "The operation couldn’t be completed. (facebookErrDomain error 3000.)" UserInfo=0x5e08620 {request_args=(
{
key = method;
value = "fql.multiquery";
},
{
key = sdk;
value = ios;
},
{
key = queries;
value = "[...the queries...]";
},
{
key = "sdk_version";
value = 2;
},
{
key = "access_token";
value = "...";
},
{
key = format;
value = json;
}
), error_msg=Only administrators of applications, pages, and domains can retrieve Insights. The session user (100000XXXXXXXXX) does not own the object 132562XXXXXXXXX., error_code=3000}
There was one query accessing the page_fans metric from insights table. The user had only the "Tester" administration privilege associated. Changing the access level of the user to "Administrator" helped.
I changed my error report via UIAlertView to include the "error_msg" from the UserInfo, as it contains important indicators for user and me in case of a failure ;)
The answer for my question is:
You'll get an facebookErrDomain code 3000 error on graph api in case you do not have proper access rights for page or application insights data.