I was trying to use the REST API of TeamCity but i can't find a list of all supported requests and the names of parameters. I wanted to look it up in their official documentation (https://confluence.jetbrains.com/display/TCD10/REST+API)
where a link to exactly this list is provided
(http://teamcity:8111/app/rest/application.wadl)
but i just can't connect to it. Seems like the page is down.
I have googled all kinds of stuff in the hope to find this list somewhere else but i couldn't find anything smart.
Does anyone know where to find such a list or can provide one? That would be fantastic.
Thanks
You can find available API on the public teamcity:
https://teamcity.jetbrains.com/app/rest/swagger.json
You can navigate through the response inside the paths and look at supported methods, and required parameters for each API.
You can also access to the .wadl on the public teamcity server:
https://teamcity.jetbrains.com/app/rest/application.wadl
When you are inside the documentation of teamcity, they use teamcity:8111 as your own teamcity, installed on your server.
The URL examples on this page assume that your TeamCity server web UI is accessible via the http://teamcity:8111 URL.
If you download a copy of teamcity, start a copy of the server, and then connect to /app/rest/application.wadl, you will probably get a copy of representation.
Related
I was wondering where I could find the REST API documentation for Strongbox and if at all it has one? Could somebody please tell me where to find this?
There are currently two ways to get the REST API documentation for Strongbox:
Get the strongbox-distribution and start it locally.
Clone the Strongbox project, (if you're interested in developing new functionality for Strongbox) and build it (by following the build instructions here) and start it locally.
You can then navigate to http://localhost:48080/docs/rest/api.html (as explained here in our wiki).
Disclaimer: I am the project owner of Strongbox.
Based on the documentation https://learn.microsoft.com/en-us/vsts/extend/overview?view=vsts#what-makes-up-an-extension, a VSTS extension can be used to extend the work item form.
However, I would like my extension to automatically create a new work item type once it is installed. Is this something that is possible? I can't find any documentation online that suggests how to do it.
Theoretically this is possible, the extension has a "first load" call which you can use to use the rest api to create a custom process or update the existing custom process. The REST Api to change processes isn't public yet, so you'll have to work from using fiddler to watch how the web ui does it.
Due to the way processes are linked to projects, all projects with that process will get the new work item type.
I could not find a lot of documentation online for this, but the VSS web extensions SDK(https://www.npmjs.com/package/vss-web-extension-sdk) has a REST client called 'ProcessDefinitionsRestClient' declared in the typings/tfs.d.ts file. This client has a createWorkItemType method available that looks like this:
createWorkItemType(workItemType: ProcessDefinitionsContracts.WorkItemTypeModel, processId: string): IPromise<ProcessDefinitionsContracts.WorkItemTypeModel>;.
The 'ProcessRestClient' client has methods to create a new/inherited process to which the new WIT can be added.
I have not tried it out yet, and these APIs are still in preview, but maybe they can get you started on the right path.
I tried to install/connect Youseeu tool in sakai throught LTI. But i am not able to find any values for the following fields
1. remote URl.
2. Remote Tool Key.
3. Remote Tool Secret.
If anybody installed youseeu in sakai or any other lms, please help me out how to do that. i search lot regarding with this, but i didn't found any accurate result.
Here is the screenshot https://snag.gy/ZHGerA.jpg.
Thanks
It looks like Youseeu does use LTI (as detailed at: https://www.youseeu.com/d2l/). Typically if it will work with d2l via LTI it will work with Sakai.
However, you'll need to get the values you've highlighted from your contact at Youseeu.
The url will be where the external tool launches to (likely on youseeu's servers). The key and secret will then both encrypt and identify your connection. These values will be unique for each institution and will be generated by Youseeu.
I'm collecting GitHub issue statistics over time on our project: total number of issues, number of issues with a particular label, number of issues in a given state (open/closed). Right now, I have a Python script to parse the project webpage with the desired labeling/state for the info I want, e.g., http://github.com/<projectname>/issues?label=<label_of_interest>&state=<state_of_interest>
However, parsing the HTML is fragile since if the GitHub API changes, more often than not, my code fails.
Does someone describe how to use the GitHub API (or barring that, know of some other way, preferably in Python) to collect these statistics without relying on the underlying HTML?
May I be so forward as to suggest that you use my wrapper around the GitHub API for this? With github3.py, you can do the following:
import github3
github = github3.login("braymp", "braymp's super secret password")
repo = github.repository("owner", "reponame")
open_issues = [i for i in repo.iter_issues()]
closed_issues = [i for i in repo.iter_issues(state='closed')]
A call to refresh may be necessary because I don't honestly recall if GitHub sends all of the issue information upon the iteration like that (e.g., replace i.refresh() for i in <generator> as the body of the list comprehensions above).
With those, you can iterate over the two lists and you will be able to use the labels attribute on each issue to figure out which labels are on an issue. If you decide to merge the two lists, you can always check the status of the issue with the is_closed method.
I suspect the actual statistics you can do yourself. :)
The documentation for github3.py can be found on ReadTheDocs and you'll be particularly interested in Issue and Repository objects.
You can also ask further questions about github3.py by adding the tag for it in your StackOverflow question.
Cheers!
I'd take a look at Octokit. Which doesn't support Python currently, but does provide a supported interface to the GitHub API for Ruby.
https://github.com/blog/1517-introducing-octokit
Although this doesn't fully meet your specifications (the "preferably Python" part), Octokit is a fantastic (and official - it's developed by GitHub) way of interacting with the GitHub API. You wrote you'd like to get Issues data. It's as easy as installing, requiring the library, and getting the data (no need for authentication if the project is public).
Install:
gem install octokit
Add this to your Ruby file to require the Octokit library:
require 'octokit'
Although there are a lot of things you can get from Octokit::Client::Issues, you may want to get a paginated list of all the issues in a repository:
Octokit.list_issues('octokit/octokit.rb')
# => [Array<Sawyer::Resource>] A list of issues for a repository.
If you're really keen on using Python, you might want to have a look at the GitHub API docs for Issues. Really, it's as easy as getting a URL like: https://api.github.com/repos/octokit/octokit.rb/issues and get the JSON data (although I'm not familiar with Python, I'm sure these some JSON parsing library); no need for authentication for public repos.
Is it possible to create a new build configuration for an existing project via REST api(POST method) in Teamcity?
If so, how to create? (some guidelines )
Thanks
It's for sure possible on 8.x, haven't the need to care about early versions.
Here's a really simple python snippet that will copy an existing build config into a given project using this as a guide http://confluence.jetbrains.com/display/TCD8/REST+API#RESTAPI-BuildConfigurationAndTemplateSettings.
import requests
xml = """<newBuildTypeDescription name='NewBuildConfigName'
sourceBuildTypeLocator='ExistingBuildConfigNameThatYouWantToCopy'
copyAllAssociatedSettings='true' shareVCSRoots='false'/>
"""
headers = {'Content-Type': 'application/xml'} # set what your server accepts
print requests.post('http://YOURTEAMCITYWEBADDRESS:YOURTEAMCITYPORT/httpAuth/app/rest/projects/id:PROJECTIDWHERENEWBUILDCONFIGSHOULDBECREATED/buildTypes', data=xml, headers=headers, auth=('TeamCityUserName','TeamCityPassword')).text
Its now possible in 8.x REST. You can do something like:
POST plain text (name) to http://teamcity:8111/httpAuth/app/rest/projects/<projectLocator>/buildTypes
Above is copied from 8.x REST. Check 8.x REST for more details.
No, it's not implemented in the REST API. Have a look at this
There is no way to create a build configuration. You can add build steps to it and configure them, but it doesn't seem to be implemented in the API at all. I was actually fighting with this myself last night. If you find a way to do it, please let me know.
Also, you could have a look at these notes I've put together concerning the Teamcity REST API. (Not that they're answering this question, but some of them could be quite useful).
Well, you can refer to this for starters: