0
# Machine Operations
1
2
Individual node/machine management within agent pools, including machine-specific operations, status monitoring, and maintenance actions. This provides granular control over individual nodes for troubleshooting, maintenance, and capacity management.
3
4
## Capabilities
5
6
### Machine Discovery
7
8
List and retrieve information about individual machines within agent pools.
9
10
```python { .api }
11
def get(
12
resource_group_name: str,
13
resource_name: str,
14
agent_pool_name: str,
15
machine_name: str,
16
**kwargs
17
) -> Machine:
18
"""
19
Get information about a specific machine.
20
21
Parameters:
22
- resource_group_name (str): The name of the resource group
23
- resource_name (str): The name of the managed cluster
24
- agent_pool_name (str): The name of the agent pool
25
- machine_name (str): The name of the machine
26
27
Returns:
28
Machine: The machine resource with properties and status
29
"""
30
31
def list(
32
resource_group_name: str,
33
resource_name: str,
34
agent_pool_name: str,
35
**kwargs
36
) -> ItemPaged[Machine]:
37
"""
38
List all machines in an agent pool.
39
40
Parameters:
41
- resource_group_name (str): The name of the resource group
42
- resource_name (str): The name of the managed cluster
43
- agent_pool_name (str): The name of the agent pool
44
45
Returns:
46
ItemPaged[Machine]: Paginated list of machines
47
"""
48
```
49
50
## Types
51
52
### Machine
53
54
```python { .api }
55
class Machine:
56
"""
57
Individual machine/node within an agent pool.
58
59
Attributes:
60
- name (str): Machine name
61
- network (MachineNetworkProperties): Network configuration
62
- resources (MachineProperties): Machine properties
63
"""
64
```
65
66
### MachineNetworkProperties
67
68
```python { .api }
69
class MachineNetworkProperties:
70
"""
71
Machine network configuration.
72
73
Attributes:
74
- ip_addresses (List[MachineIpAddress]): IP addresses assigned to the machine
75
"""
76
```
77
78
### MachineProperties
79
80
```python { .api }
81
class MachineProperties:
82
"""
83
Machine properties and resource information.
84
85
Attributes:
86
- resources (Dict[str, Any]): Resource allocations and limits
87
"""
88
```
89
90
### MachineIpAddress
91
92
```python { .api }
93
class MachineIpAddress:
94
"""
95
IP address assigned to a machine.
96
97
Attributes:
98
- family (str): IP family (IPv4, IPv6)
99
- address (str): The IP address
100
"""
101
```
102
103
## Usage Example
104
105
```python
106
from azure.mgmt.containerservice import ContainerServiceClient
107
108
client = ContainerServiceClient(credential, subscription_id)
109
110
# List all machines in an agent pool
111
machines = client.machines.list("my-rg", "my-cluster", "nodepool1")
112
for machine in machines:
113
print(f"Machine: {machine.name}")
114
if machine.network and machine.network.ip_addresses:
115
for ip in machine.network.ip_addresses:
116
print(f" IP: {ip.address} ({ip.family})")
117
118
# Get specific machine details
119
machine = client.machines.get("my-rg", "my-cluster", "nodepool1", "machine-name")
120
print(f"Machine details: {machine.name}")
121
print(f"Resources: {machine.resources}")
122
```