Example #1
0
 public static BuildLocator WithDimensions(BuildTypeLocator buildType = null,
                                           UserLocator user = null,
                                           string agentName = null,
                                           BuildStatus? status = null,
                                           bool? personal = null,
                                           bool? canceled = null,
                                           bool? running = null,
                                           bool? pinned = null,
                                           int? maxResults = null,
                                           int? startIndex = null,
                                           BuildLocator sinceBuild = null,
                                           DateTime? sinceDate = null,
                                           string[] tags = null,
                                           string branch = null
     )
 {
     return new BuildLocator
                {
                    BuildType = buildType,
                    User = user,
                    AgentName = agentName,
                    Status = status,
                    Personal = personal,
                    Canceled = canceled,
                    Running = running,
                    Pinned = pinned,
                    MaxResults = maxResults,
                    StartIndex = startIndex,
                    SinceBuild = sinceBuild,
                    SinceDate = sinceDate,
                    Tags = tags,
                    Branch = branch
                };
 }
        public IList<Investigation> InvestigationsByBuildConfiguration(BuildTypeLocator buildTypeLocator)
        {
            var investigationWrapper = _caller.GetFormat<InvestigationWrapper>("/app/rest/investigations?locator=buildType:({0})",
                buildTypeLocator);

            return investigationWrapper.Investigation ?? new List<Investigation>();
        }
Example #3
0
        public BuildConfig BuildType(BuildTypeLocator locator)
        {
            var build = _caller.GetFormat<BuildConfig>("/app/rest/buildTypes/{0}", locator);

            return build;
        }
Example #4
0
 public void SetSnapshotDependency(BuildTypeLocator locator, SnapshotDependency dependency)
 {
     _caller.PostFormat<SnapshotDependency>(dependency, HttpContentTypes.ApplicationJson,
         HttpContentTypes.ApplicationJson, "/app/rest/buildTypes/{0}/snapshot-dependencies", locator);
 }
Example #5
0
 public void SetConfigurationPauseStatus(BuildTypeLocator locator, bool isPaused)
 {
     _caller.PutFormat(isPaused, HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/paused/", locator);
 }
Example #6
0
 public void SetBuildTypeTemplate(BuildTypeLocator locatorBuildType, BuildTypeLocator locatorTemplate)
 {
     _caller.PutFormat(locatorTemplate.ToString(), HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/template", locatorBuildType);
 }
Example #7
0
        public void PutAllBuildTypeParameters(BuildTypeLocator locator, IDictionary<string, string> parameters)
        {
            if(locator == null)
                throw new ArgumentNullException("locator");
            if(parameters == null)
                throw new ArgumentNullException("parameters");

            StringWriter sw = new StringWriter();
            using(XmlTextWriter writer = new XmlTextWriter(sw))
            {
                writer.WriteStartElement("properties");
                foreach(var parameter in parameters)
                {
                    writer.WriteStartElement("property");
                    writer.WriteAttributeString("name", parameter.Key);
                    writer.WriteAttributeString("value", parameter.Value);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
            }

            _caller.PutFormat(sw.ToString(), HttpContentTypes.ApplicationXml, "/app/rest/buildTypes/{0}/parameters", locator);
        }
Example #8
0
 public void PostRawBuildTrigger(BuildTypeLocator locator, string rawXml)
 {
     _caller.PostFormat(rawXml, HttpContentTypes.ApplicationXml, "/app/rest/buildTypes/{0}/triggers", locator);
 }
Example #9
0
 public void DeleteBuildStep(BuildTypeLocator locator, string buildStepId)
 {
     _caller.DeleteFormat("/app/rest/buildTypes/{0}/steps/{1}", locator, buildStepId);
 }
Example #10
0
 public void DeleteArtifactDependency(BuildTypeLocator locator, string artifactDependencyId)
 {
     _caller.DeleteFormat("/app/rest/buildTypes/{0}/artifact-dependencies/{1}", locator, artifactDependencyId);
 }
Example #11
0
 public void DeleteAllBuildTypeParameters(BuildTypeLocator locator)
 {
     _caller.DeleteFormat("/app/rest/buildTypes/{0}/parameters", locator);
 }
Example #12
0
 public void DeleteAgentRequirement(BuildTypeLocator locator, string agentRequirementId)
 {
     _caller.DeleteFormat("/app/rest/buildTypes/{0}/agent-requirements/{1}", locator, agentRequirementId);
 }
Example #13
0
 public void AttachToTemplate(BuildTypeLocator buildTypeLocator, string buildTemplateId)
 {
     _caller.PutFormat(buildTemplateId, HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/template", buildTypeLocator);
 }
Example #14
0
 public void UpdateName(BuildTypeLocator buildTypeLocator, string newName)
 {
     _caller.PutFormat(newName, HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/name", buildTypeLocator);
 }
Example #15
0
        public BuildConfig CopyBuildConfiguration(BuildTypeLocator buildTypeLocator, ProjectLocator destinationProjectLocator, string newConfigurationName)
        {
            var data = string.Format(@"<newBuildTypeDescription name='{0}' sourceBuildTypeLocator='{1}' copyAllAssociatedSettings='true' shareVCSRoots='false'/>", newConfigurationName, buildTypeLocator);

            return _caller.PostFormat<BuildConfig>(data, HttpContentTypes.ApplicationXml, HttpContentTypes.ApplicationJson, "/app/rest/projects/{0}/buildTypes", destinationProjectLocator);
        }
Example #16
0
 public void PostRawArtifactDependency(BuildTypeLocator locator, string rawXml)
 {
     _caller.PostFormat<ArtifactDependency>(rawXml, HttpContentTypes.ApplicationXml, string.Empty, "/app/rest/buildTypes/{0}/artifact-dependencies", locator);
 }
Example #17
0
 public void PostRawBuildStep(BuildTypeLocator locator, string rawXml)
 {
     _caller.PostFormat<BuildConfig>(rawXml, HttpContentTypes.ApplicationXml, string.Empty, "/app/rest/buildTypes/{0}/steps", locator);
 }
Example #18
0
 public void DeleteBuildTrigger(BuildTypeLocator locator, string buildTriggerId)
 {
     _caller.DeleteFormat("/app/rest/buildTypes/{0}/triggers/{1}", locator, buildTriggerId);
 }
Example #19
0
 public void PostRawSnapshotDependency(BuildTypeLocator locator, XmlElement rawXml)
 {
     _caller.PostFormat(rawXml.OuterXml, HttpContentTypes.ApplicationXml, "/app/rest/buildTypes/{0}/snapshot-dependencies", locator);
 }
Example #20
0
 public void DeleteConfiguration(BuildTypeLocator locator)
 {
     _caller.DeleteFormat("/app/rest/buildTypes/{0}", locator);
 }
Example #21
0
 public void SetArtifactDependency(BuildTypeLocator locator, ArtifactDependency dependency)
 {
     _caller.PostFormat<ArtifactDependency>(dependency, HttpContentTypes.ApplicationJson,
         HttpContentTypes.ApplicationJson, "/app/rest/buildTypes/{0}/artifact-dependencies", locator);
 }
Example #22
0
 public void DeleteParameter(BuildTypeLocator locator, string parameterName)
 {
     _caller.DeleteFormat("/app/rest/buildTypes/{0}/parameters/{1}", locator, parameterName);
 }
Example #23
0
 public void SetConfigurationParameter(BuildTypeLocator locator, string key, string value)
 {
     _caller.PutFormat(value, HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/parameters/{1}", locator, key);
 }
Example #24
0
 public void DeleteSnapshotDependency(BuildTypeLocator locator, string snapshotDependencyId)
 {
     _caller.DeleteFormat("/app/rest/buildTypes/{0}/snapshot-dependencies/{1}", locator, snapshotDependencyId);
 }
Example #25
0
 public void SetConfigurationSetting(BuildTypeLocator locator, string settingName, string settingValue)
 {
     _caller.PutFormat(settingValue, HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/settings/{1}", locator, settingName);
 }
Example #26
0
 public void DownloadConfiguration(BuildTypeLocator locator, Action<string> downloadHandler)
 {
     _caller.GetDownloadFormat(downloadHandler, "/app/rest/buildTypes/{0}", locator);
 }
Example #27
0
 public void SetTrigger(BuildTypeLocator locator, BuildTrigger trigger)
 {
     _caller.PostFormat<BuildTrigger>(trigger, HttpContentTypes.ApplicationJson, HttpContentTypes.ApplicationJson,
         "/app/rest/buildTypes/{0}/triggers", locator);
 }
Example #28
0
 public bool GetConfigurationPauseStatus(BuildTypeLocator locator)
 {
     return _caller.Get<bool>(string.Format("/app/rest/buildTypes/{0}/paused/", locator.Name));
 }
Example #29
0
 public List<Branch> ByBuildLocator(BuildTypeLocator locator)
 {
     var branchesWrapper = _caller.GetFormat<BranchesWrapper>("/app/rest/buildTypes/{0}/branches", locator);
     return branchesWrapper.Branch;
 }
Example #30
0
 public void PostRawAgentRequirement(BuildTypeLocator locator, string rawXml)
 {
     _caller.PostFormat(rawXml, HttpContentTypes.ApplicationXml, "/app/rest/buildTypes/{0}/agent-requirements", locator);
 }