Skip to content
This repository was archived by the owner on Feb 12, 2019. It is now read-only.

Added support to Create, move, copy a project, Support to get the artifacts filtered and detection of many new object #60

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e2c8f0b
Added support for ParentProject and Projects inside a Project
mavezeau Dec 12, 2013
de51ece
Added support to Create, move, copy a project, Support to get the art…
mavezeau Dec 16, 2013
4620e02
Changed Json encoder to use lowercase
nheilbuth Jan 7, 2014
cebb925
Changed Post<T> method to accept object as data, to utilize jsonEncoder
nheilbuth Jan 7, 2014
1984470
Changed Projects.Create method to use Json and NewProjectDescription
nheilbuth Jan 7, 2014
4eb1f06
Added NewProjectDescription and added Project.Create with parent project
nheilbuth Jan 7, 2014
787670d
Changed ParentProjectWrapper to produce correct Json data
nheilbuth Jan 7, 2014
a64c02b
Changed lowercase serialization to camelcase
nheilbuth Jan 7, 2014
a1b41a2
Added GenerateId from mavezeau's pull request #60
nheilbuth Jan 7, 2014
2b61a16
Added options to include/not include disconnected and unauthorized ag…
nheilbuth Jan 10, 2014
2ccd8da
Added Build.ById method
nheilbuth Jan 10, 2014
794bdfe
Sync nheilbuth
mavezeau Jan 20, 2014
659d9a0
Added missing update
mavezeau Jan 20, 2014
daef148
Added support for BuildArtifactDependencies and BuildArtifactDependen…
mavezeau Jan 20, 2014
df6796f
Changed post and put to use data object instead of data.ToString
nheilbuth Feb 3, 2014
e822d19
TITLE: Modify the method DownloadFiltered to use the filename and no…
mavezeau Feb 17, 2014
bdbc64a
Added direct support for setting artifact dependencies, snapshot depe…
nheilbuth Feb 25, 2014
a46360c
Adjustments to json output of artifactdependencies, snapshotdependenc…
nheilbuth Feb 25, 2014
5440a71
Merge pull request #74 from SCTHO/master
stack72 May 6, 2014
0c773ee
Implement statistics for builds
ewilde Aug 19, 2014
cc2f0d4
Adde method inside BuildConfigs
mavezeau Aug 29, 2014
082c8ef
Merge remote-tracking branch 'remotes/upstream/pr/82'
mavezeau Aug 29, 2014
330f44b
Keep backwork compatibility fonction
mavezeau Aug 29, 2014
1437343
Fixed snapshot dependency property types
nheilbuth Jul 14, 2015
e9e772c
Commit new stock
mavezeau Nov 6, 2015
1ad50e9
Added new support of investigation and test
mavezeau Nov 9, 2015
43d578f
Introduce new GetFields method for choose needed fields on a query.
mavezeau Jan 26, 2016
9241537
Merge
mavezeau Jan 26, 2016
4eb5135
Bad merge ...
mavezeau Jan 26, 2016
23c8647
Fix
mavezeau Jan 26, 2016
a30b74a
Try to fix merge...
mavezeau Jan 26, 2016
5054fab
Merge branch 'master' of https://github.com/mavezeau/TeamCitySharp
mavezeau Jan 26, 2016
61b97d4
Merge branch 'master' of https://github.com/nheilbuth/TeamCitySharp
mavezeau Jan 26, 2016
2de2fac
Cleanup code ...
mavezeau Jan 26, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 116 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,89 +45,136 @@ To connect as a Guest:

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


Use fields specializations: Extract complex objects for specified Fields

// For each builds get only the Id, Number, Status and StartDate
var buildField = BuildField.WithFields(id: true,number:true, status: true, startDate: true);
var buildsFields = BuildsField.WithFields( buildField: buildField);
var currentListBuild = client.Builds.GetFields(buildsFields.ToString()).ByBuildConfigId(currentProjectId);

##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
* Projects
* ServerInformation
* Users
* Agents
* VcsRoots
* Changes
* BuildArtifacts
* Statistics
* Investigations

Each area has its own list of methods available

###Builds

Builds GetFields(string fields);
List<Build> SuccessfulBuildsByBuildConfigId(string buildConfigId);
Build LastSuccessfulBuildByBuildConfigId(string buildConfigId);
List<Build> FailedBuildsByBuildConfigId(string buildConfigId);
Build LastFailedBuildByBuildConfigId(string buildConfigId);
Build LastBuildByBuildConfigId(string buildConfigId);
List<Build> ErrorBuildsByBuildConfigId(string buildConfigId);
Build LastErrorBuildByBuildConfigId(string buildConfigId);
List<Build> ByBuildConfigId(string buildConfigId);
List<Build> ByConfigIdAndTag(string buildConfigId, string tag);
List<Build> ByUserName(string userName);
List<Build> ByBuildLocator(BuildLocator locator);
List<Build> AllSinceDate(DateTime date);
List<Build> AllBuildsOfStatusSinceDate(DateTime date, BuildStatus buildStatus);
List<Build> NonSuccessfulBuildsForUser(string userName);
Build LastBuildByAgent(string agentName);
List<Build> SuccessfulBuildsByBuildConfigId(string buildConfigId, List<String> param);
Build LastSuccessfulBuildByBuildConfigId(string buildConfigId);
List<Build> FailedBuildsByBuildConfigId(string buildConfigId);
Build LastFailedBuildByBuildConfigId(string buildConfigId);
Build LastBuildByBuildConfigId(string buildConfigId);
List<Build> ErrorBuildsByBuildConfigId(string buildConfigId);
Build LastErrorBuildByBuildConfigId(string buildConfigId);
Build ById(string id);
List<Build> ByBuildConfigId(string buildConfigId);
List<Build> RunningByBuildConfigId(string buildConfigId);
List<Build> ByBuildConfigId(string buildConfigId, List<String> param);
List<Build> ByBuildLocator(BuildLocator locator, List<String> param);
List<Build> ByConfigIdAndTag(string buildConfigId, string tag);
List<Build> ByUserName(string userName);
List<Build> ByBuildLocator(BuildLocator locator);
List<Build> AllSinceDate(DateTime date);
List<Build> AllBuildsOfStatusSinceDate(DateTime date, BuildStatus buildStatus);
List<Build> NonSuccessfulBuildsForUser(string userName);
List<Build> ByBranch(string branchName);
Build LastBuildByAgent(string agentName);
void Add2QueueBuildByBuildConfigId(string buildConfigId);
List<Build> AllRunningBuild();
List<Build> RetrieveEntireBuildChainFrom(string buildConfigId);
List<Build> RetrieveEntireBuildChainTo(string buildConfigId);

###Projects
List<Project> 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<BuildConfig> 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<BuildConfig> ByProjectId(string projectId);
List<BuildConfig> 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);
List<Project> All();
Projects GetFields(string fields);
Project ByName(string projectLocatorName);
Project ById(string projectLocatorId);
Project Details(Project project);
Project Create(string projectName, string sourceId, string projectId ="");
Project Move(string projectId, string destinationId);
Project Copy(string projectid, string projectName, string newProjectId, string parentProjectId="");
string GenerateID(string projectName);
void Delete(string projectName);
void DeleteById(string projectId);
void DeleteProjectParameter(string projectName, string parameterName);
void SetProjectParameter(string projectName, string settingName, string settingValue);
bool ModifParameters(string projectId, string mainprojectbranch, string variablePath);
bool ModifSettings(string projectId, string description, string fullProjectName);

###BuildConfigs

List<BuildConfig> All();
BuildConfigs GetFields(string fields);
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<BuildConfig> ByProjectId(string projectId);
List<BuildConfig> ByProjectName(string projectName);
bool ModifTrigger(string format, string oldTriggerConfigurationId, string id);
bool ModifArtifactDependencies(string format, string oldDendencyConfigurationId, string id);
bool ModifSnapshotDependencies(string format, string oldDendencyConfigurationId, string id);
BuildConfig CreateConfiguration(string projectName, string configurationName);
BuildConfig CreateConfigurationByProjectId(string projectId, string configurationName);
BuildConfig Copy(string buildConfigId, string buildConfigName, string destinationProjectId, string newBuildTypeId = "");


void SetConfigurationSetting(BuildTypeLocator locator, string settingName, string settingValue);
bool GetConfigurationPauseStatus(BuildTypeLocator locator);
void SetConfigurationPauseStatus(BuildTypeLocator locator, bool isPaused);
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 SetBuildTypeVariable(BuildTypeLocator locatorBuildType, string nameVariable, string value);
void DeleteConfiguration(BuildTypeLocator locator);
void DeleteAllBuildTypeParameters(BuildTypeLocator locator);
void PutAllBuildTypeParameters(BuildTypeLocator locator, IDictionary<string, string> parameters);
void DownloadConfiguration(BuildTypeLocator locator, Action<string> downloadHandler);
Template CopyTemplate(string templateId, string templateName, string destinationProjectId, string newTemplateId = "");
Template GetTemplate(BuildTypeLocator locator);
void AttachTemplate(BuildTypeLocator locator, string templateId);
void DetachTemplate(BuildTypeLocator locator);

/// <since>8.0</since>
void DeleteAllBuildTypeParameters(BuildTypeLocator locator);
void PutAllBuildTypeParameters(BuildTypeLocator locator, IDictionary<string, string> parameters);

###ServerInformation

Server ServerInfo();
List<Plugin> AllPlugins();
string TriggerServerInstanceBackup(BackupOptions backupOptions);
string GetBackupStatus();

###Users

List<User> All();
User Details(string userName);
List<Role> AllRolesByUserName(string userName);
Expand All @@ -137,25 +184,37 @@ Each area has its own list of methods available
List<Role> AllUserRolesByUserGroup(string userGroupName);
bool Create(string username, string name, string email, string password);
bool AddPassword(string username, string password);
bool IsAdministrator(string username);

###Agents
List<Agent> All();

List<Agent> All(bool includeDisconnected = false, bool includeUnauthorized = false);
Agents GetFields(string fields);

###VcsRoots

List<VcsRoot> 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<Change> All();
Change ByChangeId(string id);
Change LastChangeDetailByBuildConfigId(string buildConfigId);
List<Change> ByBuildConfigId(string buildConfigId);

###BuildArtifacts

void DownloadArtifactsByBuildId(string buildId, Action<string> downloadHandler);
ArtifactWrapper ByBuildConfigId(string buildConfigId);

###BuildInvestigations

List<Investigation> All();
List<Investigation> InvestigationsByBuildTypeId(string buildTypeId);

##Credits

Expand All @@ -169,4 +228,5 @@ Thanks to the following contributors:
* Alexander Fast (@mizipzor)
* Serge Baltic
* Philipp Dolder
* Mark deVilliers
* Mark deVilliers
* Marc-Andre Vezeau (@exfo)
Binary file removed packages/EasyHttp.1.6.1.0/EasyHttp.1.6.1.0.nupkg
Binary file not shown.
Binary file removed packages/EasyHttp.1.6.1.0/lib/net40/EasyHttp.dll
Binary file not shown.
Binary file removed packages/EasyHttp.1.6.1.0/lib/sl40-wp/EasyHttp.dll
Binary file not shown.
Binary file removed packages/EasyHttp.1.6.1.0/lib/sl40/EasyHttp.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/EasyHttp.1.6.80.0/lib/net40/EasyHttp.pdb
Binary file not shown.
Binary file removed packages/FakeItEasy.1.10.0/FakeItEasy.1.10.0.nupkg
Binary file not shown.
23 changes: 0 additions & 23 deletions packages/FakeItEasy.1.10.0/FakeItEasy.1.10.0.nuspec

This file was deleted.

Binary file removed packages/FakeItEasy.1.10.0/lib/net35/FakeItEasy.dll
Binary file not shown.
Binary file removed packages/FakeItEasy.1.10.0/lib/net40/FakeItEasy.dll
Binary file not shown.
Binary file removed packages/FakeItEasy.1.10.0/lib/sl40/FakeItEasy.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading