获取给定资源组中由搜索服务管理的共享专用链接资源的详细信息。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}?api-version=2024-03-01-preview
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
resourceGroupName
|
path |
True
|
string
|
当前订阅中资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。
|
searchServiceName
|
path |
True
|
string
|
与指定资源组关联的 Azure AI 搜索服务的名称。
正则表达式模式: ^(?=.{2,60}$)[a-z0-9][a-z0-9]+(-[a-z0-9]+)*$
|
sharedPrivateLinkResourceName
|
path |
True
|
string
|
由 Azure AI 管理的共享专用链接资源的名称搜索服务指定的资源组中。
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure 订阅的唯一标识符。 可以从 Azure 资源管理器 API 或门户获取此值。
|
api-version
|
query |
True
|
string
|
要用于每个请求的 API 版本。
|
名称 |
必需 |
类型 |
说明 |
x-ms-client-request-id
|
|
string
uuid
|
客户端生成的用于标识此请求的 GUID 值。 如果指定,则会将其包含在响应信息中,作为跟踪请求的一种方式。
|
响应
安全性
azure_auth
指定 Microsoft 标识平台支持的隐式授权流。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
SharedPrivateLinkResourceGet
示例请求
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python get_shared_private_link_resource.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.shared_private_link_resources.get(
resource_group_name="rg1",
search_service_name="mysearchservice",
shared_private_link_resource_name="testResource",
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json
func ExampleSharedPrivateLinkResourcesClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSharedPrivateLinkResourcesClient().Get(ctx, "rg1", "mysearchservice", "testResource", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SharedPrivateLinkResource = armsearch.SharedPrivateLinkResource{
// Name: to.Ptr("testResource"),
// Type: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource"),
// Properties: &armsearch.SharedPrivateLinkResourceProperties{
// GroupID: to.Ptr("blob"),
// PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName"),
// RequestMessage: to.Ptr("please approve"),
// Status: to.Ptr(armsearch.SharedPrivateLinkResourceStatusPending),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the details of the shared private link resource managed by the search service in the given resource group.
*
* @summary Gets the details of the shared private link resource managed by the search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json
*/
async function sharedPrivateLinkResourceGet() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const sharedPrivateLinkResourceName = "testResource";
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.sharedPrivateLinkResources.get(
resourceGroupName,
searchServiceName,
sharedPrivateLinkResourceName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json
// this example is just showing the usage of "SharedPrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// get the collection of this SharedSearchServicePrivateLinkResource
SharedSearchServicePrivateLinkResourceCollection collection = searchService.GetSharedSearchServicePrivateLinkResources();
// invoke the operation
string sharedPrivateLinkResourceName = "testResource";
NullableResponse<SharedSearchServicePrivateLinkResource> response = await collection.GetIfExistsAsync(sharedPrivateLinkResourceName);
SharedSearchServicePrivateLinkResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SharedSearchServicePrivateLinkResourceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"name": "testResource",
"type": "Microsoft.Search/searchServices/sharedPrivateLinkResources",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource",
"properties": {
"requestMessage": "please approve",
"groupId": "blob",
"privateLinkResourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName",
"status": "Pending",
"resourceRegion": null
}
}
定义
CloudError
包含有关 API 错误的信息。
名称 |
类型 |
说明 |
error
|
CloudErrorBody
|
使用错误代码和消息描述特定的 API 错误。
|
message
|
string
|
有关错误提示错误 (详细信息/调试信息的简短说明,请参阅“error.message”属性) 。
|
CloudErrorBody
使用错误代码和消息描述特定的 API 错误。
名称 |
类型 |
说明 |
code
|
string
|
描述错误条件的错误代码比 HTTP 状态代码更精确。 可用于以编程方式处理特定错误情况。
|
details
|
CloudErrorBody[]
|
包含与此错误相关的嵌套错误。
|
message
|
string
|
详细描述错误并提供调试信息的消息。
|
target
|
string
|
特定错误的目标 (例如,错误) 中属性的名称。
|
SharedPrivateLinkResource
介绍由 Azure AI 搜索服务管理的共享专用链接资源。
名称 |
类型 |
说明 |
id
|
string
|
资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
资源的名称
|
properties
|
SharedPrivateLinkResourceProperties
|
介绍由 Azure AI 搜索服务管理的共享专用链接资源的属性。
|
type
|
string
|
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”
|
SharedPrivateLinkResourceProperties
介绍由 Azure AI 搜索服务管理的现有共享专用链接资源的属性。
名称 |
类型 |
说明 |
groupId
|
string
|
共享专用链接资源所针对的资源提供程序的组 ID。
|
privateLinkResourceId
|
string
|
共享专用链接资源所针对的资源的资源 ID。
|
provisioningState
|
SharedPrivateLinkResourceProvisioningState
|
共享专用链接资源的预配状态。 有效值为 Updateing、Deleting、Failed、Succeeded 或 Incomplete。
|
requestMessage
|
string
|
请求批准共享专用链接资源的消息。
|
resourceRegion
|
string
|
可选。 可用于指定要为其创建共享专用链接的资源的 Azure 资源管理器位置。 只有 DNS 配置为区域性 (的资源(如 Azure Kubernetes 服务) )才需要这样做。
|
status
|
SharedPrivateLinkResourceStatus
|
共享专用链接资源的状态。 有效值为 Pending、Approved、Rejected 或 Disconnected。
|
SharedPrivateLinkResourceProvisioningState
共享专用链接资源的预配状态。 有效值为 Updateing、Deleting、Failed、Succeeded 或 Incomplete。
名称 |
类型 |
说明 |
Deleting
|
string
|
共享专用链接资源正在被删除。
|
Failed
|
string
|
无法预配或删除共享专用链接资源。
|
Incomplete
|
string
|
已接受共享专用链接资源的预配请求,但创建过程尚未开始。
|
Succeeded
|
string
|
共享专用链接资源已完成预配,可供审批。
|
Updating
|
string
|
共享专用链接资源正在与其他资源一起创建,以便其完全正常运行。
|
SharedPrivateLinkResourceStatus
共享专用链接资源的状态。 有效值为 Pending、Approved、Rejected 或 Disconnected。
名称 |
类型 |
说明 |
Approved
|
string
|
共享专用链接资源已获批准,可供使用。
|
Disconnected
|
string
|
共享专用链接资源已从服务中删除。
|
Pending
|
string
|
共享专用链接资源已创建,正在等待审批。
|
Rejected
|
string
|
共享专用链接资源已被拒绝,无法使用。
|