Services
Copyright 2023 Infoblox
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
1 | |
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
NiosServiceMixin
NIOS Service Mixin class
Source code in src/ibx_sdk/nios/service.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
get_service_restart_status()
Retrieves the status of a service restart.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
self
|
Gift
|
The instance of the Gift class |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the service restart status information. |
Raises:
| Type | Description |
|---|---|
RequestError
|
If there is a general request error. |
Source code in src/ibx_sdk/nios/service.py
service_restart(groups=None, members=None, mode=None, restart_option='RESTART_IF_NEEDED', services=None, user_name=None)
Restarts specified services on the grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
self
|
Gift
|
Gift object |
required |
groups
|
Optional[list]
|
List of group names. Default is None. |
None
|
members
|
Optional[list[str]]
|
List of member names. Default is None. |
None
|
mode
|
Optional[ServiceRestartMode]
|
Restart mode. Default is None. |
None
|
restart_option
|
Optional[ServiceRestartOption]
|
Restart option. The default is 'RESTART_IF_NEEDED'. |
'RESTART_IF_NEEDED'
|
services
|
Optional[list[ServiceRestartServices]]
|
List of services to restart. Default is None. |
None
|
user_name
|
Optional[str]
|
Username. Default is None. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Raises:
| Type | Description |
|---|---|
RequestError
|
If there is an error, send the restart request. |
Examples:
Restart services in a group
service_restart(groups=['group_name'])
Restart services of specific members
service_restart(members=['member1', 'member2'])
Restart services with a specific restart mode
service_restart(mode=ServiceRestartMode.IMMEDIATE)
Restart services with a specific restart option
service_restart(restart_option=ServiceRestartOption.RESTART_IF_NEEDED)
Restart specific services
service_restart(services=[ServiceRestartServices.SERVICE_NAME1, ServiceRestartServices.SERVICE_NAME2])
Restart services for a specific user
service_restart(user_name='username')
Source code in src/ibx_sdk/nios/service.py
update_service_status(services='ALL')
Updates the status of a service.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
self
|
Gift
|
The instance of the class. |
required |
services
|
str
|
The service option to update the status for. The default value is 'ALL'. |
'ALL'
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Raises:
| Type | Description |
|---|---|
RequestError
|
If an error occurs while making the request. |