public RestApiClient() { userProfileProvider = ServiceLocator.GetUserProfileProvider(); var userProfile = userProfileProvider.GetUserProfile(); if (userProfile != null) { BuildClient(userProfile.ClusterUri, userProfile.AllowInvalidServerCertificates); } }
private Uri GetUri(string fragment) { var userProfile = userProfileProvider.GetUserProfile(); if (userProfile == null) { return(null); } if (userProfile.ClusterUri == null) { return(null); } var baseUri = new Uri(userProfile.ClusterUri, CohesityConstants.ApiBasePath); if (fragment.StartsWith("/")) { fragment = fragment.TrimStart('/'); } return(new Uri(baseUri, fragment)); }