public bool CheckParameters(out string explanation) { if (!parameters.ValidateValues(out explanation)) { return(false); } if (!parameters.ArtifactName.EndsWith(".zip")) { explanation = "zip archives supported only"; return(false); } using (ServiceStack.JsonServiceClient client = new ServiceStack.JsonServiceClient(parameters.Host)) { client.SetCredentials(parameters.User, parameters.Password); client.AlwaysSendBasicAuthHeader = true; try { client.Get("httpAuth/app/rest/projects"); explanation = ""; return(true); } catch (Exception e) { explanation = e.Message; } return(false); } }
public bool CheckParameters(out string explanation) { if(!parameters.ValidateValues(out explanation)) return false; if (!parameters.ArtifactName.EndsWith(".zip")) { explanation = "zip archives supported only"; return false; } using (ServiceStack.JsonServiceClient client = new ServiceStack.JsonServiceClient(parameters.Host)) { client.SetCredentials(parameters.User, parameters.Password); client.AlwaysSendBasicAuthHeader = true; try { client.Get("httpAuth/app/rest/projects"); explanation = ""; return true; } catch (Exception e) { explanation = e.Message; } return false; } }
private ChangeRootObject GetChange(TeamCity.BuildRootObject id) { try { using (ServiceStack.JsonServiceClient client = new ServiceStack.JsonServiceClient(parameters.Host)) { client.SetCredentials(parameters.User, parameters.Password); client.AlwaysSendBasicAuthHeader = true; ChangeRootObject b = client.Get <ChangeRootObject>(id.changes.href); return(b); } } catch (Exception e) { logger.Exception(e, "GetChange", ""); return(null); } }
private BuildsRootObject GetBuilds() { try { using (ServiceStack.JsonServiceClient client = new ServiceStack.JsonServiceClient(parameters.Host)) { client.SetCredentials(parameters.User, parameters.Password); client.AlwaysSendBasicAuthHeader = true; BuildsRootObject b = client.Get <BuildsRootObject>(new BuildsRequest { buildType = parameters.BuildType, status = "SUCCESS" }); return(b); } } catch (Exception e) { logger.Exception(e, "GetBuilds", ""); return(null); } }
private ChangesRootObject GetChanges(TeamCity.ChangeRootObject id) { try { using (ServiceStack.JsonServiceClient client = new ServiceStack.JsonServiceClient(parameters.Host)) { client.SetCredentials(parameters.User, parameters.Password); client.AlwaysSendBasicAuthHeader = true; ChangesRootObject b = client.Get<ChangesRootObject>(id.change[0].href); return b; } } catch (Exception e) { logger.Exception(e, "GetChanges", ""); return null; } }
private BuildsRootObject GetBuilds() { try { using (ServiceStack.JsonServiceClient client = new ServiceStack.JsonServiceClient(parameters.Host)) { client.SetCredentials(parameters.User, parameters.Password); client.AlwaysSendBasicAuthHeader = true; BuildsRootObject b = client.Get<BuildsRootObject>(new BuildsRequest { buildType = parameters.BuildType, status = "SUCCESS" }); return b; } } catch (Exception e) { logger.Exception(e, "GetBuilds", ""); return null; } }
private ArtifcatsRootObject GetArtifact(TeamCity.BuildRootObject id) { try { using (ServiceStack.JsonServiceClient client = new ServiceStack.JsonServiceClient(parameters.Host)) { client.SetCredentials(parameters.User, parameters.Password); client.AlwaysSendBasicAuthHeader = true; ArtifcatsRootObject b = client.Get<ArtifcatsRootObject>(id.artifacts.href); return b; } } catch (Exception e) { logger.Exception(e, "GetArtifact", ""); return null; } }