Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0 (2024-10-23)
## 1.0.0 (2025-02-28)

- Azure Resource Manager Workloads Sap Virtual Instance client library for Java. This package contains Microsoft Azure SDK for Workloads Sap Virtual Instance Management SDK. Workloads client provides access to various workload operations. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
WorkloadsSapVirtualInstanceManager manager = WorkloadsSapVirtualInstanceManager
.authenticate(credential, profile);
```

The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.

See [Authentication][authenticate] for more options.

Expand Down Expand Up @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/


Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Code snippets and samples


## Operations

- [List](#operations_list)

## SapApplicationServerInstances

- [Create](#sapapplicationserverinstances_create)
Expand Down Expand Up @@ -45,6 +49,28 @@
- [Start](#sapvirtualinstances_start)
- [Stop](#sapvirtualinstances_stop)
- [Update](#sapvirtualinstances_update)
### Operations_List

```java
/**
* Samples for Operations List.
*/
public final class OperationsListSamples {
/*
* x-ms-original-file: 2024-09-01/Operations_List.json
*/
/**
* Sample code: List the operations for the provider.
*
* @param manager Entry point to WorkloadsSapVirtualInstanceManager.
*/
public static void listTheOperationsForTheProvider(
com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) {
manager.operations().list(com.azure.core.util.Context.NONE);
}
}
```

### SapApplicationServerInstances_Create

```java
Expand Down Expand Up @@ -3497,8 +3523,8 @@ public final class SapVirtualInstancesStopSamples {

```java
import com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedServiceIdentity;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SAPVirtualInstanceIdentity;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SAPVirtualInstanceIdentityType;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstance;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapVirtualInstanceProperties;
import java.util.HashMap;
Expand All @@ -3523,7 +3549,7 @@ public final class SapVirtualInstancesUpdateSamples {
.getValue();
resource.update()
.withTags(mapOf("key1", "fakeTokenPlaceholder"))
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE))
.withIdentity(new SAPVirtualInstanceIdentity().withType(SAPVirtualInstanceIdentityType.NONE))
.withProperties(new UpdateSapVirtualInstanceProperties())
.apply();
}
Expand All @@ -3543,7 +3569,7 @@ public final class SapVirtualInstancesUpdateSamples {
.getValue();
resource.update()
.withTags(mapOf("key1", "fakeTokenPlaceholder"))
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE))
.withIdentity(new SAPVirtualInstanceIdentity().withType(SAPVirtualInstanceIdentityType.NONE))
.withProperties(new UpdateSapVirtualInstanceProperties()
.withManagedResourcesNetworkAccessType(ManagedResourcesNetworkAccessType.PRIVATE))
.apply();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.workloadssapvirtualinstance.fluent.WorkloadsSapVirtualInstanceMgmtClient;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.OperationsImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapApplicationServerInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapCentralServerInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapDatabaseInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapVirtualInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.WorkloadsSapVirtualInstanceMgmtClientBuilder;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.Operations;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapApplicationServerInstances;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapCentralServerInstances;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseInstances;
Expand All @@ -47,6 +49,8 @@
* Workloads client provides access to various workload operations.
*/
public final class WorkloadsSapVirtualInstanceManager {
private Operations operations;

private SapVirtualInstances sapVirtualInstances;

private SapCentralServerInstances sapCentralServerInstances;
Expand Down Expand Up @@ -272,6 +276,18 @@ public WorkloadsSapVirtualInstanceManager authenticate(TokenCredential credentia
}
}

/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/**
* Gets the resource collection API of SapVirtualInstances. It manages SapVirtualInstance.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.resourcemanager.workloadssapvirtualinstance.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Context;
import com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.OperationInner;

/**
* An instance of this class provides access to all the operations defined in OperationsClient.
*/
public interface OperationsClient {
/**
* List the operations for the provider.
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list();

/**
* List the operations for the provider.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list(Context context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public interface WorkloadsSapVirtualInstanceMgmtClient {
*/
Duration getDefaultPollInterval();

/**
* Gets the OperationsClient object to access its operations.
*
* @return the OperationsClient object.
*/
OperationsClient getOperations();

/**
* Gets the SapVirtualInstancesClient object to access its operations.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.ActionType;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.OperationDisplay;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.Origin;
import java.io.IOException;

/**
* Details of a REST API operation, returned from the Resource Provider Operations API.
*/
@Immutable
public final class OperationInner implements JsonSerializable<OperationInner> {
/*
* The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
* "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
*/
private String name;

/*
* Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
* Resource Manager/control-plane operations.
*/
private Boolean isDataAction;

/*
* Localized display information for this particular operation.
*/
private OperationDisplay display;

/*
* The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
* value is "user,system"
*/
private Origin origin;

/*
* Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
*/
private ActionType actionType;

/**
* Creates an instance of OperationInner class.
*/
private OperationInner() {
}

/**
* Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
* "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
*
* @return the name value.
*/
public String name() {
return this.name;
}

/**
* Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
* operations and "false" for Azure Resource Manager/control-plane operations.
*
* @return the isDataAction value.
*/
public Boolean isDataAction() {
return this.isDataAction;
}

/**
* Get the display property: Localized display information for this particular operation.
*
* @return the display value.
*/
public OperationDisplay display() {
return this.display;
}

/**
* Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
* audit logs UX. Default value is "user,system".
*
* @return the origin value.
*/
public Origin origin() {
return this.origin;
}

/**
* Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are
* for internal only APIs.
*
* @return the actionType value.
*/
public ActionType actionType() {
return this.actionType;
}

/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (display() != null) {
display().validate();
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("display", this.display);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of OperationInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IOException If an error occurs while reading the OperationInner.
*/
public static OperationInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
OperationInner deserializedOperationInner = new OperationInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("name".equals(fieldName)) {
deserializedOperationInner.name = reader.getString();
} else if ("isDataAction".equals(fieldName)) {
deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
} else if ("display".equals(fieldName)) {
deserializedOperationInner.display = OperationDisplay.fromJson(reader);
} else if ("origin".equals(fieldName)) {
deserializedOperationInner.origin = Origin.fromString(reader.getString());
} else if ("actionType".equals(fieldName)) {
deserializedOperationInner.actionType = ActionType.fromString(reader.getString());
} else {
reader.skipChildren();
}
}

return deserializedOperationInner;
});
}
}
Loading