Share via


Refresh [SPFSDK][VMMREF]

 

Applies To: Windows Azure Pack

The Refresh operation will refresh an existing VPN connection with the latest information from the hosting gateway. This operation is considered an Action. For more information about how OData operations work, see OData Operations.

Request

Method

Request URI

HTTP Version

POST

https://{server-name}:{server-port}/{subscription-id}/services/systemcenter/vmm/{entity-uri}/Refresh

HTTP/1.1

Note

This OData operation requires the request URL to point to an instance of the VPNConnection [SPFSDK][VMMREF] entity. For more information, see Identify an entity through the URL. This entity type is usually provided by the VPNConnections Collection [SPFSDK][VMMREF].

Behavior

The following table describes how this operation behaves.

Setting

Value

Is composable?

False

Has side effects?

True

Requires an entity instance?

True

Return type

VPNConnection [SPFSDK][VMMREF]

Results belong to an entity set?

VPNConnections Collection [SPFSDK][VMMREF]

Parameters

None

Example: Refresh a VPN connection

For more information about how to get started with using the code examples provided in this programming guide, see Program in Visual Studio with the Windows Azure Pack IaaS Resource Provider [SPFSDK].

Guid stampId = new Guid("56ebc6dc-f63c-46e2-8438-2967e0ad83bc");
Guid vpnId = new Guid("ac145da5-e8b8-4259-aeec-15ec40db9c23");

// Get the drive we want to expand
var vpn = vmmService.VPNConnections.Where(v => v.StampId == stampId && v.ID == vpnId).First();

// Build a URI that identifies the specific drive, and uses the Expand action.
Uri refreshActionUri = new Uri(string.Format("{0}(StampId=guid'{1}',ID=guid'{2}')/Refresh", vmmService.VPNConnections.RequestUri, vpn.StampId, vpn.ID), UriKind.Absolute);

// Run the action.
var resultSet = vmmService.Execute<SpfVMM.VPNConnection>(refreshActionUri, "POST", true);

HTTP Request

POST https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/VPNConnections(StampId=guid'56ebc6dc-f63c-46e2-8438-2967e0ad83bc',ID=guid'ac145da5-e8b8-4259-aeec-15ec40db9c23')/Refresh HTTP/1.1
MaxDataServiceVersion: 3.0;NetFx
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8
DataServiceUrlConventions: KeyAsSegment
User-Agent: Microsoft ADO.NET Data Services
Authorization: Bearer {ENCODED AUTHENTICATION TOKEN}
x-ms-principal-id: tenant@fabrikam.com
Host: contoso.com:30005
Content-Length: 0

HTTP Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 694
Content-Type: application/json; odata=minimalmetadata; streaming=true; charset=utf-8
Server: Microsoft-IIS/8.5
x-ms-request-id: 9511aeaf-e170-487d-b376-f47199306945
X-Content-Type-Options: nosniff
request-id: 5fbd8ef2-63e6-0000-b3f0-c15fe663cf01
DataServiceVersion: 3.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Wed, 18 Jun 2014 01:37:55 GMT

{"odata.metadata":"https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/$metadata#VPNConnections/@Element","StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","ID":"ac145da5-e8b8-4259-aeec-15ec40db9c23","VMNetworkGatewayId":null,"Name":"VPN Connection to other internal network.","Description":null,"TargetVPNIPv4Address":"192.168.1.44","TargetVPNIPv6Address":null,"CloudVPNIPAddresses":["157.54.160.148"],"AuthenticationMethod":"PSKOnly","RunAsAccountId":null,"Status":"Enabled","LastConnectionError":null,"LastConnectionErrorCode":"0","MaximumBandwidthInboundKbps":"30000","MaximumBandwidthOutboundKbps":"10000","LastRead":"2014-06-18T01:37:54.948203Z"}

See Also

VPNConnection [SPFSDK][VMMREF]
VPNConnections Collection [SPFSDK][VMMREF]