Missing property on VSTS api result - azure-devops

I'm currently trying to do some magic using the VSTS api, but something is a little bit surprising me.
Using the method described here: https://learn.microsoft.com/en-us/rest/api/vsts/build/definitions/get?view=vsts-rest-4.1, I made a call an receive my response.
Despite the documentation, I'm not able to read the revision counter, who is simply missing from the response. That's my goal, overwrite this counter using an homemade powershell...
Is there something I shoud know about the VSTS api, like an admin restriction or something else?
Did someone met the current issue?

To get the build definition's revision counter, you should use the REST API Get definition revisions:
GET https://{accountName}.visualstudio.com/{project}/_apis/build/definitions/{definitionId}/revisions?api-version=4.1
Then you can get all the revisions ids and counts.

Related

How to call the PIM Graph API endpoints?

I am trying to call the PIM (Privileged Identity Management) REST endpoints via the Graph API using PowerShell.
In Graph Explorer I try https://graph.microsoft.com/beta/policies/roleManagementPolicies but it returns "{\"errorCode\":\"MissingProvider\",\"message\":\"The provider is missing.\",\"instanceAnnotations\":[]}"
I have gone down a rabbit hole with the MS documentation on this. Closest I got was they suggested the Powershell SDK, which is the new Microsoft.graph module. The equivalent cmdlet is Get-MgPolicyRoleManagementPolicy which returns a similar error {"errorCode":"MissingProvider","message":"The provider is missing.","instanceAnnotations":[]}.
I can't find anywhere how to supply it the missing information. I know this is beta and pretty bleeding edge, but I'm hoping someone has been down this and found a solution. There's an outstanding issue on GitHub for this, but the author/owner is conspicuously absent
This is know issue - https://github.com/microsoftgraph/microsoft-graph-docs/issues/15910?msclkid=c0822b1ca5cf11ec93ebea64a421b423
we will try to escalate this with dev team
The below query will help fix the issue.
https://graph.microsoft.com/beta/policies/roleManagementPolicies?$filter=scopeId+eq+'/'+and+scopeType+eq+'DirectoryRole'
The scopeId and scopeType are required in the URL, will raise a PR to fix the docs.

Google Cloud Resource Manager API: How to list Operations?

When doing async things (like creating a Project) with the Resource Manager API, the initial call returns an Operation struct, which you can then poll using a get API to check if the operation completed and if there was an error. However while many other APIs, and it's part of the standard long running operations prototype, the Resource Manager API doesn't seem to offer this? This is almost certainly just a case of "vendor didn't think anyone would need it", but throwing up a question in case someone knows a tricky way to list all the pending RM operations.
I am slightly confused because it seems like the web console for Google Cloud does show a list of operations, but I can't quite figure out where those come from. Maybe there is non-public API for it hidden away somewhere?
Got a response from Google that an official API is on their list but no ETA, and there is no workaround.
Also confirmed via network trace that the Cloud Console does indeed use its own magic API that can read all Operations types from every API at the same time, including project creation. But it's very specific to the needs of the console.

How to update nextBuildNumber via REST in Jenkins

Is there's a way to update the nextBuildNumber directly via Rest? I found the parameter here:
/job/MyJob/api/xml?tree=nextBuildNumber
and in the job directory, there is a nextBuildNumber file
We already use the Rest Api for creating/updating jobs and views, so it would be nice to stick to this, instead of using cli or the nextbuildnum plugin.
Edit: new approach brings another question
Java send integer value with HTTP POST
The REST API does not currently (at time of writing) support changing the value of the nextBuildNumber. As you have found you can (only) read it.
The easiest way I know to manipulate this value is through the Next Build Number plugin.

Created System Column Blank In API Call

I am making REST calls against the Reports API endpoint, and pulling that data into a separate application. I am able to pull all of the report columns with its data, with the exception of the Created (System Column), which always returns nothing/null.
To rule out the application being the issue, I used the built in Smartsheet connector in Power BI and am getting the same blank results there.
Are there any known limitation about pulling date system columns out of the API?
It looks like you discovered a bug in the Smartsheet API! Thanks for drawing attention to this. I've submitted a bug report to the dev team at Smartsheet.
Apologies for the inconvenience. What are you trying to accomplish with your application? I might be able to help you come up with a work-around.

Is there a way to get SmartSheet Forms using the REST API?

Using the SmartSheet REST API, is there any way to get the Forms associated with a Sheet (and their - the forms' - definition/metadata, such as questions, etc.)? There doesn't appear to be anything in the documentation, but I didn't know if I'm just missing it, or if it's perhaps called something else.
You're not missing anything. At this time, accessing form data through the Smartsheet API is not supported.
They said back in 2019 that it is in the nearby pipeline. Considering its mid 2021, I feel as though it has gotten lost somewhere in this pipe.