取得由指定資源群組中搜尋服務所管理之共用私人鏈接資源的詳細數據。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}?api-version=2024-03-01-preview
URI 參數
名稱 |
位於 |
必要 |
類型 |
Description |
resourceGroupName
|
path |
True
|
string
|
目前訂用帳戶內的資源組名。 您可以從 Azure 資源管理員 API 或入口網站取得這個值。
|
searchServiceName
|
path |
True
|
string
|
與指定資源群組相關聯的 Azure AI 搜尋服務 名稱。
Regex 模式: ^(?=.{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 版本。
|
名稱 |
必要 |
類型 |
Description |
x-ms-client-request-id
|
|
string
uuid
|
用戶端產生之可識別此要求的 GUID 值。 如果已指定,則會將回應資訊包含在響應資訊中,以作為追蹤要求的方式。
|
回應
安全性
azure_auth
指定 Microsoft 身分識別平台上支援的隱含授與流程。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
名稱 |
Description |
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 錯誤的相關信息。
名稱 |
類型 |
Description |
error
|
CloudErrorBody
|
描述具有錯誤碼和訊息的特定 API 錯誤。
|
message
|
string
|
提示錯誤 (詳細數據/偵錯資訊的簡短描述,請參閱 'error.message' 屬性) 。
|
CloudErrorBody
描述具有錯誤碼和訊息的特定 API 錯誤。
名稱 |
類型 |
Description |
code
|
string
|
比起 HTTP 狀態代碼,更精確地描述錯誤狀況的錯誤碼。 可用來以程式設計方式處理特定錯誤案例。
|
details
|
CloudErrorBody[]
|
包含與此錯誤相關的巢狀錯誤。
|
message
|
string
|
描述錯誤的詳細訊息,並提供偵錯資訊。
|
target
|
string
|
例如,錯誤 (中屬性的名稱) 的特定錯誤目標。
|
SharedPrivateLinkResource
描述由 Azure AI 搜尋服務 管理的共用私人鏈接資源。
名稱 |
類型 |
Description |
id
|
string
|
資源的完整資源識別碼。 例如 - /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 搜尋服務 所管理之現有共用私人鏈接資源的屬性。
名稱 |
類型 |
Description |
groupId
|
string
|
來自共用私人鏈接資源提供者的群組標識碼。
|
privateLinkResourceId
|
string
|
共用私人鏈接資源的資源資源識別碼。
|
provisioningState
|
SharedPrivateLinkResourceProvisioningState
|
共用私人鏈接資源的布建狀態。 有效值為 [更新]、[刪除]、[失敗]、[成功] 或 [不完整]。
|
requestMessage
|
string
|
要求核准共用私人鏈接資源的訊息。
|
resourceRegion
|
string
|
選擇性。 可用來指定要建立共用私人連結之資源的 Azure Resource Manager 位置。 只有 DNS 設定為區域 (的資源,例如 Azure Kubernetes Service) ,才需要此專案。
|
status
|
SharedPrivateLinkResourceStatus
|
共用私人鏈接資源的狀態。 有效值為 Pending、Approved、Rejected 或 Disconnected。
|
SharedPrivateLinkResourceProvisioningState
共用私人鏈接資源的布建狀態。 有效值為 [更新]、[刪除]、[失敗]、[成功] 或 [不完整]。
名稱 |
類型 |
Description |
Deleting
|
string
|
共用的私人鏈接資源正在進行刪除。
|
Failed
|
string
|
共用的私人鏈接資源無法布建或刪除。
|
Incomplete
|
string
|
已接受共用私人鏈接資源的布建要求,但尚未開始建立程式。
|
Succeeded
|
string
|
共用的私人鏈接資源已完成布建,並準備好進行核准。
|
Updating
|
string
|
共用的私人鏈接資源正與其他資源一起建立,讓資源能夠完整運作。
|
SharedPrivateLinkResourceStatus
共用私人鏈接資源的狀態。 有效值為 Pending、Approved、Rejected 或 Disconnected。
名稱 |
類型 |
Description |
Approved
|
string
|
共用的私人鏈接資源已核准,並可供使用。
|
Disconnected
|
string
|
共用的私人鏈接資源已從服務中移除。
|
Pending
|
string
|
已建立共用的私人鏈接資源,並擱置核准。
|
Rejected
|
string
|
共用的私人鏈接資源已遭到拒絕,而且無法使用。
|