public PSPrivateEndpointConnection GetPrivateEndpointConnection(string resourceGroupName, string serviceName, string name) { var privateEndpointConnection = BaseCmdlet.NetworkClient.SqlManagementClient.PrivateEndpointConnections.Get(resourceGroupName, serviceName, name); PSPrivateEndpointConnection psPEC = ToPsPrivateEndpointConnection(privateEndpointConnection); return(psPEC); }
public PSPrivateEndpointConnection UpdatePrivateEndpointConnectionStatus(string resourceGroupName, string serviceName, string name, string status, string description = null) { var privateEndpointConnection = BaseCmdlet.NetworkClient.SqlManagementClient.PrivateEndpointConnections.Get(resourceGroupName, serviceName, name); privateEndpointConnection.PrivateLinkServiceConnectionState.Status = status; if (!string.IsNullOrEmpty(description)) { privateEndpointConnection.PrivateLinkServiceConnectionState.Description = description; } BaseCmdlet.NetworkClient.SqlManagementClient.PrivateEndpointConnections.CreateOrUpdate(resourceGroupName, serviceName, name, privateEndpointConnection); var updatedPec = BaseCmdlet.NetworkClient.SqlManagementClient.PrivateEndpointConnections.Get(resourceGroupName, serviceName, name); PSPrivateEndpointConnection psPEC = ToPsPrivateEndpointConnection(updatedPec); return(psPEC); }
private PSPrivateEndpointConnection ToPsPrivateEndpointConnection(PrivateEndpointConnection privateEndpointConnection) { PSPrivateEndpointConnection psPEC = new PSPrivateEndpointConnection { Name = privateEndpointConnection.Name, Id = privateEndpointConnection.Id, ProvisioningState = privateEndpointConnection.ProvisioningState, }; psPEC.PrivateEndpoint = new PSPrivateEndpoint { Id = privateEndpointConnection.PrivateEndpoint.Id }; psPEC.PrivateLinkServiceConnectionState = new PSPrivateLinkServiceConnectionState { Status = privateEndpointConnection.PrivateLinkServiceConnectionState.Status, Description = privateEndpointConnection.PrivateLinkServiceConnectionState.Description, ActionRequired = privateEndpointConnection.PrivateLinkServiceConnectionState.ActionsRequired }; return(psPEC); }