Package org.azd.serviceendpoint
Class ServiceEndpointApi
- All Implemented Interfaces:
ServiceEndpointDetails
public class ServiceEndpointApi
extends AzDAsyncApi<ServiceEndpointApi>
implements ServiceEndpointDetails
Service Endpoint Api to manage service endpoint service
-
Constructor Summary
ConstructorDescriptionServiceEndpointApi
(Connection connection) Pass the connection object to work with Service endpoint Api -
Method Summary
Modifier and TypeMethodDescriptioncreateAzureRMServiceEndpoint
(String endpointName, String servicePrincipalId, String servicePrincipalKey, String tenantId, String subscriptionId, String subscriptionName) A helper method to create Azure RM service endpointcreateServiceEndpoint
(String endpointName, String endpointType, Map requestBody) Creates a new service endpointdeleteServiceEndpoint
(String endpointId, String[] projectIds) Delete a service endpointdeleteServiceEndpoint
(String endpointId, String[] projectIds, boolean deep) Delete a service endpointgetServiceEndpoint
(String endpointId) Get the service endpoint details.getServiceEndpoint
(String endpointId, ServiceEndpointActionFilter actionFilter) Get the service endpoint details.Get the service endpoints.getServiceEndpointsByNames
(String[] endpointNames) Get the service endpoints by name.getServiceEndpointsByNames
(String[] endpointNames, String[] authSchemes, boolean includeDetails, boolean includeFailed, String owner, String type) Get the service endpoints by name.shareServiceEndpoint
(String endpointId, String projectName, String connectionName) Share service endpoint across projectsupdateServiceEndpoint
(String endpointId, Map requestBody) Update the service endpointMethods inherited from class org.azd.utils.AzDAsyncApi
createAsync
-
Constructor Details
-
ServiceEndpointApi
Pass the connection object to work with Service endpoint Api- Parameters:
connection
- Connection object
-
-
Method Details
-
createServiceEndpoint
public ServiceEndpoint createServiceEndpoint(String endpointName, String endpointType, Map requestBody) throws AzDException Creates a new service endpoint- Specified by:
createServiceEndpoint
in interfaceServiceEndpointDetails
- Parameters:
endpointName
- Friendly name of the endpointendpointType
- Type of the endpointrequestBody
- Request body to create a service endpoint. Reference- Returns:
- ServiceEndpoint
ServiceEndpoint
- Throws:
AzDException
- Default Api Exception handler.
-
createAzureRMServiceEndpoint
public ServiceEndpoint createAzureRMServiceEndpoint(String endpointName, String servicePrincipalId, String servicePrincipalKey, String tenantId, String subscriptionId, String subscriptionName) throws AzDException A helper method to create Azure RM service endpoint- Specified by:
createAzureRMServiceEndpoint
in interfaceServiceEndpointDetails
- Parameters:
endpointName
- Friendly name of the endpointservicePrincipalId
- service principal IdservicePrincipalKey
- service principal keytenantId
- Tenant IdsubscriptionId
- subscription IdsubscriptionName
- subscription name- Returns:
- ServiceEndpoint
ServiceEndpoint
- Throws:
AzDException
- Default Api Exception handler.
-
getServiceEndpoint
Get the service endpoint details.- Specified by:
getServiceEndpoint
in interfaceServiceEndpointDetails
- Parameters:
endpointId
- Id of the service endpoint.- Returns:
- ServiceEndpoint
ServiceEndpoint
- Throws:
AzDException
- Default Api Exception handler.
-
getServiceEndpoint
public ServiceEndpoint getServiceEndpoint(String endpointId, ServiceEndpointActionFilter actionFilter) throws AzDException Get the service endpoint details.- Specified by:
getServiceEndpoint
in interfaceServiceEndpointDetails
- Parameters:
endpointId
- Id of the service endpoint.actionFilter
- Action filter for the service connection. It specifies the action which can be performed on the service connection.- Returns:
- ServiceEndpoint
ServiceEndpoint
- Throws:
AzDException
- Default Api Exception handler.
-
getServiceEndpoints
Get the service endpoints.- Specified by:
getServiceEndpoints
in interfaceServiceEndpointDetails
- Returns:
- ServiceEndpoints
ServiceEndpoints
- Throws:
AzDException
- Default Api Exception handler.
-
deleteServiceEndpoint
Delete a service endpoint- Specified by:
deleteServiceEndpoint
in interfaceServiceEndpointDetails
- Parameters:
endpointId
- Endpoint Id of endpoint to deleteprojectIds
- project Ids from which endpoint needs to be deleted- Throws:
AzDException
- Default Api Exception handler.
-
deleteServiceEndpoint
public Void deleteServiceEndpoint(String endpointId, String[] projectIds, boolean deep) throws AzDException Delete a service endpoint- Specified by:
deleteServiceEndpoint
in interfaceServiceEndpointDetails
- Parameters:
endpointId
- Endpoint Id of endpoint to deleteprojectIds
- project Ids from which endpoint needs to be deleteddeep
- delete the spn created by endpoint- Throws:
AzDException
- Default Api Exception handler.
-
getServiceEndpointsByNames
Get the service endpoints by name.- Specified by:
getServiceEndpointsByNames
in interfaceServiceEndpointDetails
- Parameters:
endpointNames
- Names of the service endpoints.- Returns:
- ServiceEndpoint
ServiceEndpoint
- Throws:
AzDException
- Default Api Exception handler.
-
getServiceEndpointsByNames
public ServiceEndpoints getServiceEndpointsByNames(String[] endpointNames, String[] authSchemes, boolean includeDetails, boolean includeFailed, String owner, String type) throws AzDException Get the service endpoints by name.- Specified by:
getServiceEndpointsByNames
in interfaceServiceEndpointDetails
- Parameters:
endpointNames
- Names of the service endpoints.authSchemes
- Authorization schemes used for service endpoints.includeDetails
- Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requestsincludeFailed
- Failed flag for service endpoints.owner
- Owner for service endpoints.type
- Type of the service endpoints.- Returns:
- ServiceEndpoint
ServiceEndpoint
- Throws:
AzDException
- Default Api Exception handler.
-
updateServiceEndpoint
public ServiceEndpoint updateServiceEndpoint(String endpointId, Map requestBody) throws AzDException Update the service endpoint- Specified by:
updateServiceEndpoint
in interfaceServiceEndpointDetails
- Parameters:
endpointId
- Endpoint Id of the endpoint to updaterequestBody
- Request body to update the service endpoint Reference: https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/update-service-endpoint?view=azure-devops-rest-6.1#update-service-endpoint- Returns:
- ServiceEndpoint
ServiceEndpoint
- Throws:
AzDException
- Default Api Exception handler.
-