How to update generated AutoRest code, after server REST API changed? - rest

Context
I am writing client code to access Web API REST service. I am using typed client classes by using Visual Studio 2015 "Add"/"REST API client..."
Now the serverside API changed and I would like to update my generated client code accordingly.
Question
Besides of the obvious solution of deleting all the generated classes, then starting the Visual Studio 2015 "Add"/"REST API client..." from ground zero, is there any better way to do this?

Related

Is there a .Net Client library for the SophosLabs Intelix API?

I can't seem to locate any nuget packages for it.
I'm feeling a little obtuse, but I am finding myself iterating over every status code for the calls to each endpoint, mapping out the returned objects.
Is there a Visual Studio tool that creates the client interface from the YAML files that consumes the API?
Good question, unfortunately at time of writing there isn't a client library for Intelix in .NET.

TFS 2018 REST API Call for Backlogs // API Version 4.1

we have TFS 2018 and are able to call the following URL using PAT for authorization:
https://our.tfs/tfs/Our.Project.Collection/Our Team Project/_apis/wit/workitems?ids=1234&?api-version=2.0
This quite basic call returns expected results.
Trying to request API calls from the following documentation results always in 404 Page not found:
https://learn.microsoft.com/de-de/rest/api/vsts/work/backlogs/list?view=vsts-rest-4.1
For example:
https://our.tfs/tfs/Our.ProjectCollection/Our Team Project/_apis/work/backlogs?api-version=4.1
which yields the mentioned 404 error.
According Microsoft, the API is supported in version 4.0 on TFS 2018:
https://learn.microsoft.com/en-us/vsts/integrate/concepts/rest-api-versioning?view=tfs-2018
However, it seems calling the API in version 4.1 in the way the documentation describes it here only works for VSTS but not for TFS
Do I understand it correctly that any API calls to API version greater than 4.0 are currently only supported by VSTS but not on TFS on prem?
This would mean we have to live with API calls documented in the "Previous REST API Versions" when using TFS 2018 on prem?
The REST API format you used is incorrect, you missed the Team parameter
The format should be:
GET http://tfs2018:8080/tfs/DefaultCollection/{Project}/{Team}/_apis/work/backlogs?api-version=4.1-preview.1
It works without any issue on my side.
I believe you will get something by taking a look at these links, see
Visual Studio Team Services REST API Reference
REST API Overview for Visual Studio Team Services and Team Foundation Server
I was able to follow this example:
https://{instance}[/{collection}[/{team-project}]/_apis[/{area}]/{resource}?api-version={version}
see what Microsoft speaks about version 4.1 of this doc.
APIs e uso REST comuns
Discussion on TFS MS Apis
Similar discussion
Hugs

MS Project server 2016 update custom fields on tasks

For Project Server 2013 we’ve been using the SOAP API’s QueueUpdateProjectRequest to achieve this but in 2016 we can’t even checkout the project using SOAP.
We try to POST to /PWA/_vti_bin/psi/Project.asmx:
<?xml version='1.0' encoding='UTF-8' ?><ns2:Envelope xmlns:ns3="http://schemas.microsoft.com/office/project/server/webservices/Project/" xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/"><ns2:Header></ns2:Header><ns2:Body><ns3:CheckOutProject><ns3:projectUid>7475f3ef-226e-e611-80d3-0050568a983b</ns3:projectUid><ns3:sessionUid>c430ce2b-057e-4990-b5b6-9c6f28415739</ns3:sessionUid><ns3:sessionDescription></ns3:sessionDescription></ns3:CheckOutProject></ns2:Body></ns2:Envelope>
and get:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://Microsoft.Office.Project.Server">a:ProjectServerFaultCode</faultcode><faultstring>Unhandled Communication Fault occurred</faultstring><detail><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Incorrect inproc routing. No inproc host is available for Project.</string></detail></s:Fault></s:Body></s:Envelope>
We’ve also tried writing the custom field values using custom field internal names when Merge Posting to /ProjectServer/Projects('{#project}')/Draft/Tasks('{#Id}’.
The server seems to ignore the custom field values while correctly updating system field values.
There is documentation for updating custom fields on Project, but not on Task: https://github.com/OfficeDev/Project-REST-Basic-Operations/blob/master/updateprojectcustomfieldvalues.ps1
What is the proper way for updating custom fields on Tasks in Project Server 2016?
According to Microsoft, there is no Project class in the PSI anymore:
https://technet.microsoft.com/en-us/library/mt422816(v=office.16).aspx#Anchor_2
Project Server Interface (PSI) Project class removed
The Project class in the PSI is not supported in Project Server 2016. For all new development, use the Project Client Side Object Model (CSOM).
I'm getting the same error for calling PSI functions from the Project class.
I'm not 100% sure, but I guess on the server itself, the REST/SOAP operations are still using the PSI in the end, so you get the same error.
No idea whether you can still achieve what you need with the REST/SOAP.
The solution will be to use CSOM (as suggested by Microsoft), but I don't know if it fits your application.

How OrientDB Studio Code Works?

I have a question regarding the way the OrientDB studio works.
When I build my own web application to access the OrientDB database, I need to enable CORS and then it works, but how comes that the OrientDB studio app works without having to enable CORS?
That's really puzzling me because I'd like to reuse the code logic of the OrientDB Studio app in my own application and it does not work like the OrientDB Studio app.
Also, it seems that the OrientDB Studio app is using the REST API of OrientDB, not the JavaScript API (orientdb-api.js). Am I right?
Is there any documentation I could read to get a full understanding of how the Studio works?
Regards,
Jeremie
You need to enable CORS because your app it is outside the domain of ODB. if you are running it in localhost is http://localhost:2480.
So if you make a request from a different domain the browser stops you if the server has CORS disabled.
Studio starts as a plugin inside ODB http (http://localhost:2480/studio/index.html) so is allowed to do request without enabling CORS.
If you do not want to enable CORS you can put your html and js under the www directory in
the $ORIENTDB_HOME distribution.
There is no documentation about Studio Code. You can browse it here https://github.com/orientechnologies/orientdb-studio if you need some further information you can ask me as i'm the main maintainer of Studio :D
I can tell you that it does not use the orientdb-api.js as it uses angular.js.
I advice you to not use orientdb-api.js but uses directly the REST api
with JQuery/Angular.

Azure - generating REST SDKs from IDL

I want to build REST-based web services on Microsoft Azure. I want to define my web service APIs using some kind of IDL from which client SDKs for various programming languages can be generated. Ideally, even client documentation, test code, and client sample code could be generated.
Outside the Azure world, there are tools like Swagger and RAML that attempt to do this. Does anyone know of an equivalent, existing or planned, in the Azure space?
Yes, this is coming very soon - http://blogs.msdn.com/b/windowsazure/archive/2013/10/23/microsoft-acquires-apiphany.aspx.