The Get Resource Provider by Name operation returns the specified resource provider in the system as a resource provider object

Request

The Get Resource Provider by Name request may be specified as follows. Replace <resource-provider-id> with your resource provider ID

Method Request URI HTTP Version

GET

https://admin-management.contoso.net/resourceproviders/<resource-provider-ID>

HTTP/1.1

URI Parameters

None.

Request Headers

The following table describes request headers.

Request Header Description

Authorization

Specifies the credentials for this request. The value of this header must be set Negotiate <token>.

Request Body

None.

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

The status code is embedded in the response for this operation; if successful, it will be status code 200 (OK).

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Header Description

Content-Length

This lists the number of resource providers in the system

Response Body

The format of the response body is as follows:

  Copy Code
{ 
	"Name": "T2VPPBGD", 
	"DisplayName": "DisplayName:T2VPPBGD", 
	"Enabled": true, 
	"PassThroughEnabled": true, 
	"AllowAnonymousAccess": false, 
	"AdminEndpoint": { "ForwardingAddress": "http://energy:8005/dummy/T2VPPBGD/AdminEndpoint", "AuthenticationMode": 0 }, 
	"TenantEndpoint": { "ForwardingAddress": "http://energy:8005/dummy/T2VPPBGD/TenantEndpoint", "AuthenticationMode": 0 }, 
	"NotificationEndpoint": { "ForwardingAddress": "http://energy:8005/dummy/T2VPPBGD/NotificationEndpoint", "AuthenticationMode": 0 } 
}

The following table describes the key elements of the response body:

Element Name

Description

Name

A name for the resource provider that is unique

DisplayName

The name can be used identify the resource provider for your tracking purposes.

Enabled

Specifies whether the resource provider is created in enabled state.

PassThroughEnabled

Specifies whether the resource provider is created in passthrough-enabled state.

AllowAnonymousAccess

Specifies anonymous access mode for the resource provider

AdminEndpoint

Specifies the forwarding address for the administrator endpoint

TenantEndpoint

Specifies the forwarding address for the tenant endpoint

NotificationEndpoint

Specifies the forwarding address for the notification endpoint

Example

Get a resource provider by name.

  Copy Code
public Offer GetResourceProviderByName(string adminServiceEndpoint, string resprovidername)
{
	HttpClient httpClient = new HttpClient();
	httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("BASIC", Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes("AdminPortal:" + ”password”)))));

	string subscriptionEndpoint = adminServiceEndpoint + "resourceproviders/" + resprovidername;
	var response = httpClient.GetAsync(subscriptionEndpoint);
	var resultsStr = response.Result.Content.ReadAsStringAsync().Result;
	var result = JsonConvert.DeserializeObject<Offer>(resultsStr);
	Console.WriteLine(resultsStr);
	return result;
}