Skip to content

[AutoPR azure-ai-anomalydetector] Support ad test 1 #2967

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

Closed
wants to merge 5 commits into from
Closed
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
4 changes: 4 additions & 0 deletions eng/mgmt/automation/api-specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ containerregistry:
suffix: generated
containerservice:
suffix: generated
containerservice/Microsoft.ContainerService/aks:
suffix: generated
containerservice/Microsoft.ContainerService/fleet:
service: containerservicefleet
cosmos-db:
service: cosmos
suffix: generated
Expand Down
9 changes: 6 additions & 3 deletions eng/mgmt/automation/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
generate,
get_and_update_service_from_api_specs,
get_suffix_from_api_specs,
update_spec,
)

os.chdir(pwd)
Expand Down Expand Up @@ -117,16 +118,17 @@ def sdk_automation_autorest(config: dict) -> List[dict]:

for readme in config['relatedReadmeMdFiles']:
match = re.search(
'specification/([^/]+)/resource-manager/readme.md',
'specification/([^/]+)/resource-manager(/.*)*/readme.md',
readme,
re.IGNORECASE,
)
if not match:
logging.info(
'[Skip] readme path does not format as specification/*/resource-manager/readme.md'
'[Skip] readme path does not format as specification/*/resource-manager/*/readme.md'
)
else:
spec = match.group(1)
spec = update_spec(spec, match.group(2))
service = get_and_update_service_from_api_specs(
api_specs_file, spec)

Expand Down Expand Up @@ -209,7 +211,7 @@ def main():

readme = args['readme']
match = re.match(
'specification/([^/]+)/resource-manager/readme.md',
'specification/([^/]+)/resource-manager(/.*)*/readme.md',
readme,
re.IGNORECASE,
)
Expand All @@ -218,6 +220,7 @@ def main():
readme = 'specification/{0}/resource-manager/readme.md'.format(spec)
else:
spec = match.group(1)
spec = update_spec(spec, match.group(2))

args['readme'] = readme
args['spec'] = spec
Expand Down
2 changes: 1 addition & 1 deletion eng/mgmt/automation/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def generate(


def compile_package(sdk_root: str, group_id: str, module: str) -> bool:
command = 'mvn --no-transfer-progress clean verify package -f {0}/pom.xml -Dmaven.javadoc.skip -Dgpg.skip -DskipTestCompile -Drevapi.skip -pl {1}:{2} -am'.format(
command = 'mvn --no-transfer-progress clean verify package -f {0}/pom.xml -Dmaven.javadoc.skip -Dgpg.skip -DskipTestCompile -Djacoco.skip -Drevapi.skip -pl {1}:{2} -am'.format(
sdk_root, group_id, module)
logging.info(command)
if os.system(command) != 0:
Expand Down
6 changes: 6 additions & 0 deletions eng/mgmt/automation/generate_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,9 @@ def get_suffix_from_api_specs(api_specs_file: str, spec: str):
return api_spec.get('suffix')

return None


def update_spec(spec: str, subspec: str) -> str:
if subspec:
spec = spec + subspec
return spec
2 changes: 1 addition & 1 deletion eng/mgmt/automation/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

SDK_ROOT = '../../../' # related to file dir
AUTOREST_CORE_VERSION = '3.9.3'
AUTOREST_JAVA = '@autorest/[email protected].13'
AUTOREST_JAVA = '@autorest/[email protected].14'
DEFAULT_VERSION = '1.0.0-beta.1'
GROUP_ID = 'com.azure.resourcemanager'
API_SPECS_FILE = 'api-specs.yaml'
Expand Down
7 changes: 5 additions & 2 deletions eng/mgmt/automation/sdk_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
generate,
get_and_update_service_from_api_specs,
get_suffix_from_api_specs,
update_spec,
)

os.chdir(pwd)
Expand Down Expand Up @@ -162,16 +163,17 @@ def sdk_automation_autorest(config: dict) -> List[dict]:

readme = config['relatedReadmeMdFile']
match = re.search(
'(specification)?/?([^/]+)/resource-manager/readme.md',
'(specification)?/?([^/]+)/resource-manager(/.*)*/readme.md',
readme,
re.IGNORECASE,
)
if not match:
logging.info(
'[Skip] readme path does not format as */resource-manager/readme.md'
'[Skip] readme path does not format as */resource-manager/*/readme.md'
)
else:
spec = match.group(2)
spec = update_spec(spec, match.group(3))
service = get_and_update_service_from_api_specs(
api_specs_file, spec)

Expand Down Expand Up @@ -267,6 +269,7 @@ def main():
readme = 'specification/{0}/resource-manager/readme.md'.format(spec)
else:
spec = match.group(1)
spec = update_spec(spec, match.group(2))

args['readme'] = readme
args['spec'] = spec
Expand Down
1 change: 1 addition & 0 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ com.azure.resourcemanager:azure-resourcemanager-billingbenefits;1.0.0-beta.1;1.0
com.azure.resourcemanager:azure-resourcemanager-providerhub;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-reservations;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-storagemover;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.0.0-beta.1;1.0.0-beta.1
com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1
com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public Mono<Response<BinaryData>> detectUnivariateChangePointWithResponse(
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return detection results for the given resultId along with {@link Response} on successful completion of {@link
* @return detections results for the given resultId along with {@link Response} on successful completion of {@link
* Mono}.
*/
@Generated
Expand Down Expand Up @@ -701,7 +701,7 @@ public Mono<Response<BinaryData>> getMultivariateModelWithResponse(String modelI
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return detection results for the given resultId along with {@link Response} on successful completion of {@link
* @return detections results for the given resultId along with {@link Response} on successful completion of {@link
* Mono}.
*/
@Generated
Expand Down Expand Up @@ -885,7 +885,7 @@ public Mono<UnivariateChangePointDetectionResult> detectUnivariateChangePoint(
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return detection results for the given resultId on successful completion of {@link Mono}.
* @return detections results for the given resultId on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down Expand Up @@ -940,8 +940,9 @@ public Mono<AnomalyDetectionModel> trainMultivariateModel(ModelInfo modelInfo) {
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response of listing models as paginated response with {@link PagedFlux}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedFlux<AnomalyDetectionModel> listMultivariateModels(Integer skip, Integer top) {
public PagedFlux<AnomalyDetectionModel> listMultivariateModels(Integer skip, Integer top) {
// Generated convenience method for listMultivariateModels
RequestOptions requestOptions = new RequestOptions();
if (skip != null) {
Expand Down Expand Up @@ -1081,7 +1082,7 @@ public Mono<AnomalyDetectionModel> getMultivariateModel(String modelId) {
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return detection results for the given resultId on successful completion of {@link Mono}.
* @return detections results for the given resultId on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public Response<BinaryData> detectUnivariateChangePointWithResponse(
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return detection results for the given resultId along with {@link Response}.
* @return detections results for the given resultId along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down Expand Up @@ -690,7 +690,7 @@ public Response<BinaryData> getMultivariateModelWithResponse(String modelId, Req
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return detection results for the given resultId along with {@link Response}.
* @return detections results for the given resultId along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down Expand Up @@ -873,7 +873,7 @@ public UnivariateChangePointDetectionResult detectUnivariateChangePoint(
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return detection results for the given resultId.
* @return detections results for the given resultId.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down Expand Up @@ -928,8 +928,9 @@ public AnomalyDetectionModel trainMultivariateModel(ModelInfo modelInfo) {
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response of listing models as paginated response with {@link PagedIterable}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AnomalyDetectionModel> listMultivariateModels(Integer skip, Integer top) {
public PagedIterable<AnomalyDetectionModel> listMultivariateModels(Integer skip, Integer top) {
// Generated convenience method for listMultivariateModels
return new PagedIterable<>(client.listMultivariateModels(skip, top));
}
Expand Down Expand Up @@ -1016,7 +1017,7 @@ public AnomalyDetectionModel getMultivariateModel(String modelId) {
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return detection results for the given resultId.
* @return detections results for the given resultId.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ public Response<BinaryData> detectUnivariateChangePointWithResponse(
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return detection results for the given resultId along with {@link Response} on successful completion of {@link
* @return detections results for the given resultId along with {@link Response} on successful completion of {@link
* Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down Expand Up @@ -920,7 +920,7 @@ public Mono<Response<BinaryData>> getMultivariateBatchDetectionResultWithRespons
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return detection results for the given resultId along with {@link Response}.
* @return detections results for the given resultId along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> getMultivariateBatchDetectionResultWithResponse(
Expand Down Expand Up @@ -1753,7 +1753,7 @@ public Response<BinaryData> getMultivariateModelWithResponse(String modelId, Req
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return detection results for the given resultId along with {@link Response} on successful completion of {@link
* @return detections results for the given resultId along with {@link Response} on successful completion of {@link
* Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down Expand Up @@ -1855,7 +1855,7 @@ public Mono<Response<BinaryData>> detectMultivariateBatchAnomalyWithResponseAsyn
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return detection results for the given resultId along with {@link Response}.
* @return detections results for the given resultId along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> detectMultivariateBatchAnomalyWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,43 @@

package com.azure.ai.anomalydetector.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collection;

/** Defines values for AlignMode. */
public enum AlignMode {
/** Enum value Inner. */
INNER("Inner"),
public final class AlignMode extends ExpandableStringEnum<AlignMode> {
/** Static value Inner for AlignMode. */
public static final AlignMode INNER = fromString("Inner");

/** Enum value Outer. */
OUTER("Outer");
/** Static value Outer for AlignMode. */
public static final AlignMode OUTER = fromString("Outer");

/** The actual serialized value for a AlignMode instance. */
private final String value;

AlignMode(String value) {
this.value = value;
}
/**
* Creates a new instance of AlignMode value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Deprecated
public AlignMode() {}

/**
* Parses a serialized value to a AlignMode instance.
* Creates or finds a AlignMode from its string representation.
*
* @param value the serialized value to parse.
* @return the parsed AlignMode object, or null if unable to parse.
* @param name a name to look for.
* @return the corresponding AlignMode.
*/
@JsonCreator
public static AlignMode fromString(String value) {
if (value == null) {
return null;
}
AlignMode[] items = AlignMode.values();
for (AlignMode item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
public static AlignMode fromString(String name) {
return fromString(name, AlignMode.class);
}

/** {@inheritDoc} */
@JsonValue
@Override
public String toString() {
return this.value;
/**
* Gets known AlignMode values.
*
* @return known AlignMode values.
*/
public static Collection<AlignMode> values() {
return values(AlignMode.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines values for DataSchema. */
/** Data schema of input data source: OneTable or MultiTable. The default DataSchema is OneTable. */
public final class DataSchema extends ExpandableStringEnum<DataSchema> {
/** Static value OneTable for DataSchema. */
public static final DataSchema ONE_TABLE = fromString("OneTable");

/** Static value MultiTable for DataSchema. */
public static final DataSchema MULTI_TABLE = fromString("MultiTable");

/**
* Creates a new instance of DataSchema value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Deprecated
public DataSchema() {}

/**
* Creates or finds a DataSchema from its string representation.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines values for FillNAMethod. */
/**
* An optional field, indicating how missing values will be filled. One of Previous, Subsequent, Linear, Zero, Fixed.
*/
public final class FillNAMethod extends ExpandableStringEnum<FillNAMethod> {
/** Static value Previous for FillNAMethod. */
public static final FillNAMethod PREVIOUS = fromString("Previous");
Expand All @@ -25,6 +27,14 @@ public final class FillNAMethod extends ExpandableStringEnum<FillNAMethod> {
/** Static value Fixed for FillNAMethod. */
public static final FillNAMethod FIXED = fromString("Fixed");

/**
* Creates a new instance of FillNAMethod value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Deprecated
public FillNAMethod() {}

/**
* Creates or finds a FillNAMethod from its string representation.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ public final class ImputeMode extends ExpandableStringEnum<ImputeMode> {
/** Static value notFill for ImputeMode. */
public static final ImputeMode NOT_FILL = fromString("notFill");

/**
* Creates a new instance of ImputeMode value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Deprecated
public ImputeMode() {}

/**
* Creates or finds a ImputeMode from its string representation.
*
Expand Down
Loading