Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MA] Renaming Datasource to DataSource (to be consistent with other SDKs) #22682

Merged
merged 2 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.azure.ai.metricsadvisor.administration.models.DataFeed;
import com.azure.ai.metricsadvisor.administration.models.DataFeedIngestionProgress;
import com.azure.ai.metricsadvisor.administration.models.DataFeedIngestionStatus;
import com.azure.ai.metricsadvisor.administration.models.DatasourceCredentialEntity;
import com.azure.ai.metricsadvisor.administration.models.DataSourceCredentialEntity;
import com.azure.ai.metricsadvisor.administration.models.ListAnomalyAlertConfigsOptions;
import com.azure.ai.metricsadvisor.administration.models.ListCredentialEntityOptions;
import com.azure.ai.metricsadvisor.administration.models.ListDataFeedIngestionOptions;
Expand Down Expand Up @@ -918,40 +918,40 @@ public PagedIterable<AnomalyAlertConfiguration> listAlertConfigs(
* Create a data source credential entity.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.createDatasourceCredential#DatasourceCredentialEntity}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.createDataSourceCredential#DatasourceCredentialEntity}
*
* @param datasourceCredential The credential entity.
* @return The created {@link DatasourceCredentialEntity}.
* @param dataSourceCredential The credential entity.
* @return The created {@link DataSourceCredentialEntity}.
* @throws NullPointerException thrown if the {@code credentialEntity} is null
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DatasourceCredentialEntity createDatasourceCredential(DatasourceCredentialEntity datasourceCredential) {
return createDatasourceCredentialWithResponse(datasourceCredential, Context.NONE).getValue();
public DataSourceCredentialEntity createDataSourceCredential(DataSourceCredentialEntity dataSourceCredential) {
return createDataSourceCredentialWithResponse(dataSourceCredential, Context.NONE).getValue();
}

/**
* Create a data source credential entity with REST response.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.createDatasourceCredentialWithResponse#DatasourceCredentialEntity-Context}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.createDataSourceCredentialWithResponse#DatasourceCredentialEntity-Context}
*
* @param datasourceCredential The credential entity.
* @param dataSourceCredential The credential entity.
* @param context Additional context that is passed through the HTTP pipeline during the service call.
*
* @return A {@link Response} containing the created {@link DatasourceCredentialEntity}.
* @return A {@link Response} containing the created {@link DataSourceCredentialEntity}.
* @throws NullPointerException thrown if the {@code credentialEntity} is null
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<DatasourceCredentialEntity> createDatasourceCredentialWithResponse(
DatasourceCredentialEntity datasourceCredential, Context context) {
return client.createDatasourceCredentialWithResponse(datasourceCredential, context).block();
public Response<DataSourceCredentialEntity> createDataSourceCredentialWithResponse(
DataSourceCredentialEntity dataSourceCredential, Context context) {
return client.createDataSourceCredentialWithResponse(dataSourceCredential, context).block();
}

/**
* Get a data source credential entity by its id.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.getDatasourceCredential#String}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.getDataSourceCredential#String}
*
* @param credentialId The data source credential entity unique id.
*
Expand All @@ -960,15 +960,15 @@ public Response<DatasourceCredentialEntity> createDatasourceCredentialWithRespon
* @throws NullPointerException thrown if the {@code credentialId} is null.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DatasourceCredentialEntity getDatasourceCredential(String credentialId) {
return getDatasourceCredentialWithResponse(credentialId, Context.NONE).getValue();
public DataSourceCredentialEntity getDataSourceCredential(String credentialId) {
return getDataSourceCredentialWithResponse(credentialId, Context.NONE).getValue();
}

/**
* Get a data source credential entity by its id with REST response.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.getDatasourceCredentialWithResponse#String-Context}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.getDataSourceCredentialWithResponse#String-Context}
*
* @param credentialId The data source credential entity unique id.
* @param context Additional context that is passed through the HTTP pipeline during the service call.
Expand All @@ -978,66 +978,66 @@ public DatasourceCredentialEntity getDatasourceCredential(String credentialId) {
* @throws NullPointerException thrown if the {@code dataFeedId} is null.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<DatasourceCredentialEntity> getDatasourceCredentialWithResponse(String credentialId,
public Response<DataSourceCredentialEntity> getDataSourceCredentialWithResponse(String credentialId,
Context context) {
return client.getDatasourceCredentialWithResponse(credentialId, context).block();
return client.getDataSourceCredentialWithResponse(credentialId, context).block();
}

/**
* Update a data source credential entity.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.updateDatasourceCredential#DatasourceCredentialEntity}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.updateDataSourceCredential#DatasourceCredentialEntity}
*
* @param datasourceCredential The credential entity.
* @param dataSourceCredential The credential entity.
*
* @return The updated {@link DatasourceCredentialEntity}.
* @return The updated {@link DataSourceCredentialEntity}.
* @throws NullPointerException thrown if the {@code credentialEntity} is null
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DatasourceCredentialEntity updateDatasourceCredential(DatasourceCredentialEntity datasourceCredential) {
return updateDatasourceCredentialWithResponse(datasourceCredential, Context.NONE).getValue();
public DataSourceCredentialEntity updateDataSourceCredential(DataSourceCredentialEntity dataSourceCredential) {
return updateDataSourceCredentialWithResponse(dataSourceCredential, Context.NONE).getValue();
}

/**
* Update a data source credential entity.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.updateDatasourceCredentialWithResponse#DatasourceCredentialEntity-Context}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.updateDataSourceCredentialWithResponse#DatasourceCredentialEntity-Context}
*
* @param datasourceCredential The credential entity.
* @param dataSourceCredential The credential entity.
* @param context Additional context that is passed through the HTTP pipeline during the service call.
*
* @return A {@link Response} containing the updated {@link DatasourceCredentialEntity}.
* @return A {@link Response} containing the updated {@link DataSourceCredentialEntity}.
* @throws NullPointerException thrown if the {@code credentialEntity} is null
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<DatasourceCredentialEntity> updateDatasourceCredentialWithResponse(
DatasourceCredentialEntity datasourceCredential, Context context) {
return client.updateDatasourceCredentialWithResponse(datasourceCredential, context).block();
public Response<DataSourceCredentialEntity> updateDataSourceCredentialWithResponse(
DataSourceCredentialEntity dataSourceCredential, Context context) {
return client.updateDataSourceCredentialWithResponse(dataSourceCredential, context).block();
}

/**
* Delete a data source credential entity.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.deleteDatasourceCredential#String}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.deleteDataSourceCredential#String}
*
* @param credentialId The data source credential entity unique id.
*
* @throws IllegalArgumentException If {@code credentialId} does not conform to the UUID format specification.
* @throws NullPointerException thrown if the {@code credentialId} is null.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteDatasourceCredential(String credentialId) {
deleteDatasourceCredentialWithResponse(credentialId, Context.NONE);
public void deleteDataSourceCredential(String credentialId) {
deleteDataSourceCredentialWithResponse(credentialId, Context.NONE);
}

/**
* Delete a data source credential entity with REST response.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.deleteDatasourceCredentialWithResponse#String-Context}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.deleteDataSourceCredentialWithResponse#String-Context}
*
* @param credentialId The data source credential entity unique id.
* @param context Additional context that is passed through the HTTP pipeline during the service call.
Expand All @@ -1047,40 +1047,40 @@ public void deleteDatasourceCredential(String credentialId) {
* @throws NullPointerException thrown if the {@code dataFeedId} is null.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<Void> deleteDatasourceCredentialWithResponse(String credentialId, Context context) {
public Response<Void> deleteDataSourceCredentialWithResponse(String credentialId, Context context) {
return client.deleteDataFeedWithResponse(credentialId, context).block();
}

/**
* List information of all data source credential entities on the metrics advisor account.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.listDatasourceCredentials}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.listDataSourceCredentials}
*
* @return A {@link PagedIterable} containing information of all the {@link DatasourceCredentialEntity}
* @return A {@link PagedIterable} containing information of all the {@link DataSourceCredentialEntity}
* in the account.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<DatasourceCredentialEntity> listDatasourceCredentials() {
return listDatasourceCredentials(null, Context.NONE);
public PagedIterable<DataSourceCredentialEntity> listDataSourceCredentials() {
return listDataSourceCredentials(null, Context.NONE);
}

/**
* List information of all data source credential entities on the metrics advisor account.
*
* <p><strong>Code sample</strong></p>
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.listDatasourceCredentials#ListCredentialEntityOptions-Context}
* {@codesnippet com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.listDataSourceCredentials#ListCredentialEntityOptions-Context}
*
* @param options The configurable {@link ListCredentialEntityOptions options} to pass for filtering the output
* result.
* @param context Additional context that is passed through the Http pipeline during the service call.
*
* @return A {@link PagedIterable} containing information of all the {@link DatasourceCredentialEntity}
* @return A {@link PagedIterable} containing information of all the {@link DataSourceCredentialEntity}
* in the account.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<DatasourceCredentialEntity> listDatasourceCredentials(
public PagedIterable<DataSourceCredentialEntity> listDataSourceCredentials(
ListCredentialEntityOptions options, Context context) {
return new PagedIterable<>(client.listDatasourceCredentials(options, context));
return new PagedIterable<>(client.listDataSourceCredentials(options, context));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public final class AzureBlobDataFeedSource extends DataFeedSource {
/*
* The authentication type to access the data source.
*/
private final DatasourceAuthenticationType authType;
private final DataSourceAuthenticationType authType;

static {
AzureBlobDataFeedSourceAccessor.setAccessor(
Expand All @@ -51,7 +51,7 @@ public String getConnectionString(AzureBlobDataFeedSource feedSource) {
private AzureBlobDataFeedSource(final String connectionString,
final String container,
final String blobTemplate,
final DatasourceAuthenticationType authType) {
final DataSourceAuthenticationType authType) {
this.connectionString = connectionString;
this.container = container;
this.blobTemplate = blobTemplate;
Expand All @@ -70,7 +70,7 @@ private AzureBlobDataFeedSource(final String connectionString,
public static AzureBlobDataFeedSource fromBasicCredential(final String connectionString,
final String container,
final String blobTemplate) {
return new AzureBlobDataFeedSource(connectionString, container, blobTemplate, DatasourceAuthenticationType.BASIC);
return new AzureBlobDataFeedSource(connectionString, container, blobTemplate, DataSourceAuthenticationType.BASIC);
}

/**
Expand All @@ -89,7 +89,7 @@ public static AzureBlobDataFeedSource fromManagedIdentityCredential(final String
return new AzureBlobDataFeedSource(connectionString,
container,
blobTemplate,
DatasourceAuthenticationType.MANAGED_IDENTITY);
DataSourceAuthenticationType.MANAGED_IDENTITY);
}

/**
Expand All @@ -115,7 +115,7 @@ public String getBlobTemplate() {
*
* @return The authentication type.
*/
public DatasourceAuthenticationType getAuthenticationType() {
public DataSourceAuthenticationType getAuthenticationType() {
return this.authType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public final class AzureDataExplorerDataFeedSource extends DataFeedSource {
/*
* The authentication type to access the data source.
*/
private final DatasourceAuthenticationType authType;
private final DataSourceAuthenticationType authType;

static {
AzureDataExplorerDataFeedSourceAccessor.setAccessor(
Expand All @@ -44,7 +44,7 @@ public String getConnectionString(AzureDataExplorerDataFeedSource feedSource) {
private AzureDataExplorerDataFeedSource(final String connectionString,
final String query,
final String credentialId,
final DatasourceAuthenticationType authType) {
final DataSourceAuthenticationType authType) {
this.connectionString = connectionString;
this.query = query;
this.credentialId = credentialId;
Expand All @@ -61,7 +61,7 @@ private AzureDataExplorerDataFeedSource(final String connectionString,
*/
public static AzureDataExplorerDataFeedSource fromBasicCredential(final String connectionString,
final String query) {
return new AzureDataExplorerDataFeedSource(connectionString, query, null, DatasourceAuthenticationType.BASIC);
return new AzureDataExplorerDataFeedSource(connectionString, query, null, DataSourceAuthenticationType.BASIC);
}

/**
Expand All @@ -78,18 +78,18 @@ public static AzureDataExplorerDataFeedSource fromManagedIdentityCredential(fina
return new AzureDataExplorerDataFeedSource(connectionString,
query,
null,
DatasourceAuthenticationType.MANAGED_IDENTITY);
DataSourceAuthenticationType.MANAGED_IDENTITY);
}

/**
* Create a AzureDataExplorerDataFeedSource with the {@code credentialId} identifying a credential
* entity of type {@link DatasourceServicePrincipal}, the entity contains
* entity of type {@link DataSourceServicePrincipal}, the entity contains
* Service Principal to access the SQL Server.
*
* @param connectionString The connection string.
* @param query The query that retrieves the values to be analyzed for anomalies.
* @param credentialId The unique id of a credential entity of type
* {@link DatasourceServicePrincipal}.
* {@link DataSourceServicePrincipal}.
*
* @return The SQLServerDataFeedSource.
*/
Expand All @@ -99,18 +99,18 @@ public static AzureDataExplorerDataFeedSource fromServicePrincipalCredential(fin
return new AzureDataExplorerDataFeedSource(connectionString,
query,
credentialId,
DatasourceAuthenticationType.SERVICE_PRINCIPAL);
DataSourceAuthenticationType.SERVICE_PRINCIPAL);
}

/**
* Create a AzureDataExplorerDataFeedSource with the {@code credentialId} identifying a credential
* entity of type {@link DatasourceServicePrincipalInKeyVault}, the entity contains
* entity of type {@link DataSourceServicePrincipalInKeyVault}, the entity contains
* details of the KeyVault holding the Service Principal to access the SQL Server.
*
* @param connectionString The connection string.
* @param query The query that retrieves the values to be analyzed for anomalies.
* @param credentialId The unique id of a credential entity of type
* {@link DatasourceServicePrincipalInKeyVault}.
* {@link DataSourceServicePrincipalInKeyVault}.
*
* @return The AzureDataExplorerDataFeedSource.
*/
Expand All @@ -121,7 +121,7 @@ public static AzureDataExplorerDataFeedSource fromServicePrincipalInKeyVaultCred
return new AzureDataExplorerDataFeedSource(connectionString,
query,
credentialId,
DatasourceAuthenticationType.SERVICE_PRINCIPAL_IN_KV);
DataSourceAuthenticationType.SERVICE_PRINCIPAL_IN_KV);
}

/**
Expand All @@ -134,7 +134,7 @@ public String getQuery() {
}

/**
* Gets the id of the {@link DatasourceCredentialEntity credential resource} to authenticate the data source.
* Gets the id of the {@link DataSourceCredentialEntity credential resource} to authenticate the data source.
*
* @return The credential resource id.
*/
Expand All @@ -147,7 +147,7 @@ public String getCredentialId() {
*
* @return The authentication type.
*/
public DatasourceAuthenticationType getAuthenticationType() {
public DataSourceAuthenticationType getAuthenticationType() {
return this.authType;
}

Expand Down
Loading