Giter Club home page Giter Club logo

teamcitysharp's Introduction

#TeamCitySharp

*.NET Library to access TeamCity via their REST API.

For more information on TeamCity visit: http://www.jetbrains.com/teamcity

##Releases Please find the release notes here

##License http://stack72.mit-license.org/

##Installation There are 2 ways to use TeamCitySharp:

  • install-package TeamCitysharp (via Nuget)
  • Download source and compile

##Build Monitor

  • There is a sample build monitor built with TeamCitySharp. It can be found at TeamCityMonitor

##Sample Usage To get a list of projects

var client = new TeamCityClient("localhost:81");
client.Connect("admin", "qwerty");
var projects = client.Projects.All();

To get a list of running builds

var client = new TeamCityClient("localhost:81");
client.Connect("admin", "qwerty");
var builds = client.Builds.ByBuildLocator(BuildLocator.RunningBuilds());

##Connecting to a server

To connect as an authenticated user:

var client = new TeamCityClient("localhost:81");
client.Connect("username", "password");

To connect as a Guest:

var client = new TeamCityClient("localhost:81");
client.ConnectAsGuest();

##API Interaction Groups There are many tasks that the TeamCity API can do for us. TeamCitySharp groups these tasks into specialist areas

  • Builds
  • Projects
  • BuildConfigs
  • ServerInformation
  • Users
  • Agents
  • VcsRoots
  • Changes
  • BuildArtifacts

Each area has its own list of methods available

###Builds List SuccessfulBuildsByBuildConfigId(string buildConfigId); Build LastSuccessfulBuildByBuildConfigId(string buildConfigId); List FailedBuildsByBuildConfigId(string buildConfigId); Build LastFailedBuildByBuildConfigId(string buildConfigId); Build LastBuildByBuildConfigId(string buildConfigId); List ErrorBuildsByBuildConfigId(string buildConfigId); Build LastErrorBuildByBuildConfigId(string buildConfigId); List ByBuildConfigId(string buildConfigId); List ByConfigIdAndTag(string buildConfigId, string tag); List ByUserName(string userName); List ByBuildLocator(BuildLocator locator); List AllSinceDate(DateTime date); List AllBuildsOfStatusSinceDate(DateTime date, BuildStatus buildStatus); List NonSuccessfulBuildsForUser(string userName); Build LastBuildByAgent(string agentName);

###Projects List All(); Project ByName(string projectLocatorName); Project ById(string projectLocatorId); Project Details(Project project); Project Create(string projectName); void Delete(string projectName); void DeleteProjectParameter(string projectName, string parameterName); void SetProjectParameter(string projectName, string settingName, string settingValue);

###BuildConfigs List All(); BuildConfig ByConfigurationName(string buildConfigName); BuildConfig ByConfigurationId(string buildConfigId); BuildConfig ByProjectNameAndConfigurationName(string projectName, string buildConfigName); BuildConfig ByProjectNameAndConfigurationId(string projectName, string buildConfigId); BuildConfig ByProjectIdAndConfigurationName(string projectId, string buildConfigName); BuildConfig ByProjectIdAndConfigurationId(string projectId, string buildConfigId); List ByProjectId(string projectId); List ByProjectName(string projectName); BuildConfig CreateConfiguration(string projectName, string configurationName);

void SetConfigurationSetting(BuildTypeLocator locator, string settingName, string settingValue);
void PostRawArtifactDependency(BuildTypeLocator locator, string rawXml);
void PostRawBuildStep(BuildTypeLocator locator, string rawXml);
void PostRawBuildTrigger(BuildTypeLocator locator, string rawXml);
void SetConfigurationParameter(BuildTypeLocator locator, string key, string value);
void PostRawAgentRequirement(BuildTypeLocator locator, string rawXml);
void DeleteBuildStep(BuildTypeLocator locator, string buildStepId);
void DeleteArtifactDependency(BuildTypeLocator locator, string artifactDependencyId);
void DeleteAgentRequirement(BuildTypeLocator locator, string agentRequirementId);
void DeleteParameter(BuildTypeLocator locator, string parameterName);
void DeleteBuildTrigger(BuildTypeLocator locator, string buildTriggerId);

void SetBuildTypeTemplate(BuildTypeLocator locatorBuildType, BuildTypeLocator locatorTemplate);
void DeleteSnapshotDependency(BuildTypeLocator locator, string snapshotDependencyId);
void PostRawSnapshotDependency(BuildTypeLocator locator, XmlElement rawXml);
BuildConfig BuildType(BuildTypeLocator locator);

void DeleteConfiguration(BuildTypeLocator locator);
void DeleteAllBuildTypeParameters(BuildTypeLocator locator);
void PutAllBuildTypeParameters(BuildTypeLocator locator, IDictionary<string, string> parameters);
void DownloadConfiguration(BuildTypeLocator locator, Action<string> downloadHandler);

###ServerInformation Server ServerInfo(); List AllPlugins(); string TriggerServerInstanceBackup(BackupOptions backupOptions);

###Users List All(); User Details(string userName); List AllRolesByUserName(string userName); List AllGroupsByUserName(string userName); List AllUserGroups(); List AllUsersByUserGroup(string userGroupName); List AllUserRolesByUserGroup(string userGroupName); bool Create(string username, string name, string email, string password); bool AddPassword(string username, string password);

###Agents List All();

###VcsRoots List All(); VcsRoot ById(string vcsRootId); VcsRoot AttachVcsRoot(BuildTypeLocator locator, VcsRoot vcsRoot); void DetachVcsRoot(BuildTypeLocator locator, string vcsRootId); void SetVcsRootField(VcsRoot vcsRoot, VcsRootField field, object value);

###Changes List All(); Change ByChangeId(string id); Change LastChangeDetailByBuildConfigId(string buildConfigId); List ByBuildConfigId(string buildConfigId);

###BuildArtifacts void DownloadArtifactsByBuildId(string buildId, Action downloadHandler);

##Credits

Copyright (c) 2013 Paul Stack (@stack72)

Thanks to the following contributors:

  • Barry Mooring (@codingbadger)
  • Simon Bartlett (@sibartlett)
  • Mike Larah (@MikeLarah)
  • Alexander Fast (@mizipzor)
  • Serge Baltic
  • Philipp Dolder
  • Mark deVilliers

teamcitysharp's People

Contributors

stack72 avatar hypersw avatar alexanderfast avatar codingbadger avatar sibartlett avatar benphegan avatar mdevilliers avatar mikeevanslarah avatar howardvanrooijen avatar mikeedwardseduserv avatar philippdolder avatar jincod avatar

Watchers

Andy Royle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.