Cantumkan sumber daya komputasi yang saat ini sedang dipantau oleh sumber daya sub akun Logz.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}/listVMHosts?api-version=2020-10-01
Parameter URI
Nama |
Dalam |
Diperlukan |
Jenis |
Deskripsi |
monitorName
|
path |
True
|
string
|
Memantau nama sumber daya
|
resourceGroupName
|
path |
True
|
string
|
Nama grup sumber daya. Nama tidak peka huruf besar/kecil.
|
subAccountName
|
path |
True
|
string
|
Nama sumber daya Sub Akun
|
subscriptionId
|
path |
True
|
string
|
ID langganan target.
|
api-version
|
query |
True
|
string
|
Versi API yang digunakan untuk operasi ini.
|
Respons
Contoh
SubAccount_VMHosts_List
Sample Request
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Logz/monitors/myMonitor/accounts/SubAccount1/listVMHosts?api-version=2020-10-01
/** Samples for SubAccount ListVMHosts. */
public final class Main {
/*
* x-ms-original-file: specification/logz/resource-manager/Microsoft.Logz/stable/2020-10-01/examples/SubAccount_VMHosts_List.json
*/
/**
* Sample code: SubAccount_VMHosts_List.
*
* @param manager Entry point to LogzManager.
*/
public static void subAccountVMHostsList(com.azure.resourcemanager.logz.LogzManager manager) {
manager
.subAccounts()
.listVMHosts("myResourceGroup", "myMonitor", "SubAccount1", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.logz import MicrosoftLogz
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-logz
# USAGE
python sub_account_vmhosts_list.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 = MicrosoftLogz(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.sub_account.list_vm_hosts(
resource_group_name="myResourceGroup",
monitor_name="myMonitor",
sub_account_name="SubAccount1",
)
for item in response:
print(item)
# x-ms-original-file: specification/logz/resource-manager/Microsoft.Logz/stable/2020-10-01/examples/SubAccount_VMHosts_List.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 armlogz_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/logz/armlogz"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/logz/resource-manager/Microsoft.Logz/stable/2020-10-01/examples/SubAccount_VMHosts_List.json
func ExampleSubAccountClient_NewListVMHostsPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armlogz.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSubAccountClient().NewListVMHostsPager("myResourceGroup", "myMonitor", "SubAccount1", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.VMResourcesListResponse = armlogz.VMResourcesListResponse{
// Value: []*armlogz.VMResources{
// {
// AgentVersion: to.Ptr("1.0.0beta"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtual1"),
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtual1",
"agentVersion": "1.0.0beta"
}
],
"nextLink": null
}
Definisi
ErrorAdditionalInfo
Info tambahan kesalahan manajemen sumber daya.
Nama |
Jenis |
Deskripsi |
info
|
object
|
Info tambahan.
|
type
|
string
|
Jenis info tambahan.
|
ErrorDetail
Detail kesalahan.
Nama |
Jenis |
Deskripsi |
additionalInfo
|
ErrorAdditionalInfo[]
|
Info tambahan kesalahan.
|
code
|
string
|
Kode kesalahan.
|
details
|
ErrorDetail[]
|
Detail kesalahan.
|
message
|
string
|
Pesan kesalahan.
|
target
|
string
|
Target kesalahan.
|
ErrorResponse
Respons kesalahan
Nama |
Jenis |
Deskripsi |
error
|
ErrorDetail
|
Objek kesalahan.
|
VMResources
Id Sumber Daya VM
Nama |
Jenis |
Deskripsi |
agentVersion
|
string
|
Versi agen Logz yang diinstal pada VM.
|
id
|
string
|
Permintaan daftar operasi pembaruan host vm.
|
VMResourcesListResponse
Respons daftar Operasi Pembaruan Host VM.
Nama |
Jenis |
Deskripsi |
nextLink
|
string
|
Tautkan ke kumpulan hasil berikutnya, jika ada.
|
value
|
VMResources[]
|
Respons daftar operasi pembaruan host vm.
|