I am trying to fetch the list of all build items in Azure, and using Postman the following URL shows me the result:
https://dev.azure.com/MyOrganization/MyProject/_apis/build/builds?api-version=6.0
But there is one problem, the query shows me the build for all our company projects whereas I am only intersted in one
The query returns for all projects, but I am only interested in build for Project B
How can I specify this information in the API? I tried the filters and it doesn't work.
Also the same for tags
If you take a look at the API Build List documentation, you can see the optional parameters that can be passed to this request
In this case, you would want to filter on builds from the project B repository, which requires the repositoryType parameter to be passed as well. As such you'd be looking to call
https://dev.azure.com/{organization}/{project}/_apis/build/builds?repositoryID={repoID}&repositoryType=Git&api-version=6.0
Where the repoID can be found be going into project settings-->repository, clicking the project B repo and copying the value that appears in the website URL after repo=
Related
I am using Microsoft.SharePointOnline.CSOM. Authentication works fine and I can get the following api to work fine.
https://company.sharepoint.com/sites/{site}/_api/lists
This gives me results and that shows my integration/authentication works fine.
Now I have a list in this site. To query the list I have tried below;
https://company.sharepoint.com/sites/{site}/_api/lists(guid'{guid}')/items
https://company.sharepoint.com/sites/{site}/_api/lists/getbytitle('{list-name}')/items
In both cases it returns 404. But the list exists and list name does NOT have any spaces (so no encoding is needed). The GUID is also confirmed to be accurate.
Does it take some time to reflect the changes for the newly created list to appear in api results?
Are their any configurations that needs to be done to the list (like allow to be queried via api)?
You missed web in the url.
It shuoud be /_api/web/lists/getbytitle('{list-name}')
The get repository api (link) works like "search". For example, when I have "foo-bar" repository and I use /repos/MY_NAME/foo it returns foo-bar.
There seems to be no option for disabling this lenient repo name.
Search API just returns more than one item that worsk for the :repo
i want to add my project's endpoint in the project tear down script. What is the syntax in order to get the endpoint for all requests and test requests as the user will assign their endpoint via all requests and test requests before running the project?
i seen an example using test step but i don't want to retrieve it via the test step route:
testRunner.testCase.getTestStepByName("dd").getHttpRequest().getEndpoint();
The tear down script use either , log, context, runner nd project variables.
Thanks
Based on the information updated in the question, it looks like you have to access the endpoint in the TearDown Script of the project.
It also appears that you would need to execute the same set of tests against different base url of the endpoint and domain. Not sure even you might need to use the credentials accordingly.
Considering the above, it would be easy to project level properties.
Here you would go:
Create a project level custom property for base url, say BASE_URL as property name and value as http://10.0.0.1:8008. Of course, change it with actual value as needed with respect to the tests to be executed.
Similarly create another project level property for domain, say DOMAIN_NAME and provide its value according the test.
Double click on service / interface, click on Service Endpoints tab.
Remove all the existing values.
Add a new endpoint by clicking + icon.
Add ${#Project#BASE_URL} as endpoint and ${#Project#DOMAIN_NAME} as domain values
If required, you use the same approach for the credentials.
Now click on Assign button there and choose All requests and Tests option from the dropdown.
Similarly, do the same if you have multiple services / interfaces.
How to access the above values in TearDown Script?
log.info "Endpoint : ${project.getPropertyValue('BASE_URL')}"
log.info "Domain : ${project.getPropertyValue('DOMAIN_NAME')}"
When you want to change domain or base url, just change the values of the respective project properties before you run execute the tests against different servers / environments.
EDIT:
The values for the endpoint or domain can passed dynamically (without even changing value saved in the project) from command line using SOAPUI_HOME/bin/testrunner utility while executing the tests. For more details, refer documentation
Is there any way to build a GitLab URL for a milestone or project based on its id property instead of the slug?
Context:
I have an app that I use as a GitLab web hook, and from its front end would like to link back to GitLab. I'm keeping the project and milestone ids, as they are unique, but can't find a way to link back to them. Ideally something like: http://gitlab.example.com/project/83/milestone/113 or even http://gitlab.example.com/milestone/113 would work for me (even if they do a redirect).
Examining rake routes and config/routes.rb tells me that such routes do not exist.
The only options I can see are:
store just the slugs which are also unique. Your request and memory usage will be slightly larger, but it's worth it.
make an extra API request to get the slugs. This requires 2 requests, so it is worse than having a larger request.
For new routes of form /something to be created in gitlab, something needs to be blacklisted at https://github.com/gitlabhq/gitlabhq/blob/199029b842de7c9d52b5c95bdc1cc897da8e5560/lib/gitlab/blacklist.rb, and interestingly projects is already blacklisted, but it is currently only used for project creation.
milestones however is not blacklisted: so a user could be called milestiones and that would generate ambiguity.
I would also take a close look at how GitHub organizes its API and paths, as it is likely to be optimal: is ID web access possible in GitHub?
Example:
https://basecamp.com/1234567/api/v1/projects.json?archived=false
I do not think this works. Although the server returns with 200 status code and all the projects versus just the projects which are not archived.
We don't support those parameters. Instead, you could request all of the projects https://github.com/basecamp/bcx-api/blob/master/sections/projects.md, and then request the archived projects: GET /projects/archived.json. From there, you can work out your active projects.
Note that GET /projects.json only returns active projects, so there's no need for an ?archived=false flag.