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,8 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2022-11-18)

- Azure Resource Manager AzureTrafficCollector client library for Java. This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. Azure Traffic Collector service. Package tag package-2022-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
27 changes: 15 additions & 12 deletions sdk/networkfunction/azure-resourcemanager-networkfunction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager AzureTrafficCollector client library for Java.

This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. Azure Traffic Collector service. Package tag package-2022-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. Azure Traffic Collector service. Package tag package-2022-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-networkfunction</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -41,19 +41,19 @@ Various documentation is available to help you get started

Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.

[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation.

### Authentication

By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.

In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

With above configuration, `azure` client can be authenticated by following code:
With above configuration, `azure` client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
Expand Down Expand Up @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on

## Contributing

For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
For details on contributing to this repository, see the [contributing guide][cg].

1. Fork it
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Commit your changes (`git commit -am 'Add some feature'`)
1. Push to the branch (`git push origin my-new-feature`)
1. Create new Pull Request
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://cla.microsoft.com>.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact <[email protected]> with any additional questions or comments.

<!-- LINKS -->
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
Expand All @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
[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/
64 changes: 51 additions & 13 deletions sdk/networkfunction/azure-resourcemanager-networkfunction/SAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
- [Delete](#collectorpolicies_delete)
- [Get](#collectorpolicies_get)
- [List](#collectorpolicies_list)
- [UpdateTags](#collectorpolicies_updatetags)

## NetworkFunction

- [ListOperations](#networkfunction_listoperations)
### AzureTrafficCollectors_CreateOrUpdate

```java
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/** Samples for AzureTrafficCollectors CreateOrUpdate. */
public final class AzureTrafficCollectorsCreateOrUpdateSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorCreate.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorCreate.json
*/
/**
* Sample code: Create a traffic collector.
Expand All @@ -51,7 +51,6 @@ public final class AzureTrafficCollectorsCreateOrUpdateSamples {
.withRegion("West US")
.withExistingResourceGroup("rg1")
.withTags(mapOf("key1", "value1"))
.withCollectorPolicies(Arrays.asList())
.create();
}

Expand All @@ -76,7 +75,7 @@ import com.azure.core.util.Context;
/** Samples for AzureTrafficCollectors Delete. */
public final class AzureTrafficCollectorsDeleteSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorDelete.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorDelete.json
*/
/**
* Sample code: Delete Traffic Collector.
Expand All @@ -98,7 +97,7 @@ import com.azure.core.util.Context;
/** Samples for AzureTrafficCollectors GetByResourceGroup. */
public final class AzureTrafficCollectorsGetByResourceGroupSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorGet.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorGet.json
*/
/**
* Sample code: Get Traffic Collector.
Expand All @@ -123,7 +122,7 @@ import java.util.Map;
/** Samples for AzureTrafficCollectors UpdateTags. */
public final class AzureTrafficCollectorsUpdateTagsSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorUpdateTags.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorUpdateTags.json
*/
/**
* Sample code: Update Traffic Collector tags.
Expand Down Expand Up @@ -158,7 +157,7 @@ import com.azure.core.util.Context;
/** Samples for AzureTrafficCollectorsByResourceGroup ListByResourceGroup. */
public final class AzureTrafficCollectorsByResourceGroupListByResourceGroupSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorsByResourceGroupList.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsByResourceGroupList.json
*/
/**
* Sample code: List of Traffic Collectors by ResourceGroup.
Expand All @@ -180,7 +179,7 @@ import com.azure.core.util.Context;
/** Samples for AzureTrafficCollectorsBySubscription List. */
public final class AzureTrafficCollectorsBySubscriptionListSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorsBySubscriptionList.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsBySubscriptionList.json
*/
/**
* Sample code: List of Traffic Collectors by Subscription.
Expand Down Expand Up @@ -210,7 +209,7 @@ import java.util.Arrays;
/** Samples for CollectorPolicies CreateOrUpdate. */
public final class CollectorPoliciesCreateOrUpdateSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPolicyCreate.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyCreate.json
*/
/**
* Sample code: Create a collection policy.
Expand All @@ -222,6 +221,7 @@ public final class CollectorPoliciesCreateOrUpdateSamples {
manager
.collectorPolicies()
.define("cp1")
.withRegion("West US")
.withExistingAzureTrafficCollector("rg1", "atc")
.withIngestionPolicy(
new IngestionPolicyPropertiesFormat()
Expand Down Expand Up @@ -256,7 +256,7 @@ import com.azure.core.util.Context;
/** Samples for CollectorPolicies Delete. */
public final class CollectorPoliciesDeleteSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPolicyDelete.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyDelete.json
*/
/**
* Sample code: Delete Collection Policy.
Expand All @@ -278,7 +278,7 @@ import com.azure.core.util.Context;
/** Samples for CollectorPolicies Get. */
public final class CollectorPoliciesGetSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPolicyGet.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyGet.json
*/
/**
* Sample code: Get Collection Policy.
Expand All @@ -300,7 +300,7 @@ import com.azure.core.util.Context;
/** Samples for CollectorPolicies List. */
public final class CollectorPoliciesListSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPoliciesList.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPoliciesList.json
*/
/**
* Sample code: List of Collection Policies.
Expand All @@ -314,6 +314,44 @@ public final class CollectorPoliciesListSamples {
}
```

### CollectorPolicies_UpdateTags

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.networkfunction.models.CollectorPolicy;
import java.util.HashMap;
import java.util.Map;

/** Samples for CollectorPolicies UpdateTags. */
public final class CollectorPoliciesUpdateTagsSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyUpdateTags.json
*/
/**
* Sample code: Update Collector Policy tags.
*
* @param manager Entry point to AzureTrafficCollectorManager.
*/
public static void updateCollectorPolicyTags(
com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager) {
CollectorPolicy resource =
manager.collectorPolicies().getWithResponse("rg1", "atc", "cp1", Context.NONE).getValue();
resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply();
}

@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
```

### NetworkFunction_ListOperations

```java
Expand All @@ -322,7 +360,7 @@ import com.azure.core.util.Context;
/** Samples for NetworkFunction ListOperations. */
public final class NetworkFunctionListOperationsSamples {
/*
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/OperationsList.json
* x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/OperationsList.json
*/
/**
* Sample code: OperationsList.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for AzureTrafficCollector Management</name>
<description>This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Traffic Collector service. Package tag package-2022-05-01.</description>
<description>This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Traffic Collector service. Package tag package-2022-11-01.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ public interface AzureTrafficCollectorsClient {
*
* @param resourceGroupName The name of the resource group.
* @param azureTrafficCollectorName Azure Traffic Collector name.
* @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 the specified Azure Traffic Collector in a specified resource group.
* @return the specified Azure Traffic Collector in a specified resource group along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
AzureTrafficCollectorInner getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName);
Response<AzureTrafficCollectorInner> getByResourceGroupWithResponse(
String resourceGroupName, String azureTrafficCollectorName, Context context);

/**
* Gets the specified Azure Traffic Collector in a specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param azureTrafficCollectorName Azure Traffic Collector name.
* @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 the specified Azure Traffic Collector in a specified resource group along with {@link Response}.
* @return the specified Azure Traffic Collector in a specified resource group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AzureTrafficCollectorInner> getByResourceGroupWithResponse(
String resourceGroupName, String azureTrafficCollectorName, Context context);
AzureTrafficCollectorInner getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName);

/**
* Creates or updates a Azure Traffic Collector resource.
Expand Down Expand Up @@ -170,28 +170,28 @@ SyncPoller<PollResult<Void>, Void> beginDelete(
* @param resourceGroupName The name of the resource group.
* @param azureTrafficCollectorName Azure Traffic Collector name.
* @param parameters Parameters supplied to update Azure Traffic Collector tags.
* @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 azure Traffic Collector resource.
* @return azure Traffic Collector resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
AzureTrafficCollectorInner updateTags(
String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters);
Response<AzureTrafficCollectorInner> updateTagsWithResponse(
String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters, Context context);

/**
* Updates the specified Azure Traffic Collector tags.
*
* @param resourceGroupName The name of the resource group.
* @param azureTrafficCollectorName Azure Traffic Collector name.
* @param parameters Parameters supplied to update Azure Traffic Collector tags.
* @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 azure Traffic Collector resource along with {@link Response}.
* @return azure Traffic Collector resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AzureTrafficCollectorInner> updateTagsWithResponse(
String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters, Context context);
AzureTrafficCollectorInner updateTags(
String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters);
}
Loading