Query the specified instance information. Args: instance_name (str): The deployed instance name. provider (ServiceProviderParameters): The cloud provider information, for eas need region(eg: ch-hangzhou), access_key_id and access_key_secret.
(self, instance_name: str, provider: ServiceProviderParameters)
| 242 | return None |
| 243 | |
| 244 | def get(self, instance_name: str, provider: ServiceProviderParameters): |
| 245 | """Query the specified instance information. |
| 246 | |
| 247 | Args: |
| 248 | instance_name (str): The deployed instance name. |
| 249 | provider (ServiceProviderParameters): The cloud provider information, for eas |
| 250 | need region(eg: ch-hangzhou), access_key_id and access_key_secret. |
| 251 | |
| 252 | Raises: |
| 253 | RequestError: The request is failed from server. |
| 254 | |
| 255 | Returns: |
| 256 | Dict: The information of the requested service instance. |
| 257 | """ |
| 258 | params = GetServiceParameters(provider=provider) |
| 259 | path = '%s/api/v1/deployer/endpoint/%s?%s' % ( |
| 260 | self.endpoint, instance_name, params.to_query_str()) |
| 261 | r = requests.get(path, cookies=self.cookies, headers=self.headers) |
| 262 | handle_http_response(r, logger, self.cookies, 'get_service') |
| 263 | if r.status_code == HTTPStatus.OK: |
| 264 | if is_ok(r.json()): |
| 265 | data = r.json()[API_RESPONSE_FIELD_DATA] |
| 266 | return data |
| 267 | else: |
| 268 | raise RequestError(r.json()[API_RESPONSE_FIELD_MESSAGE]) |
| 269 | else: |
| 270 | raise_for_http_status(r) |
| 271 | return None |
| 272 | |
| 273 | def delete(self, instance_name: str, provider: ServiceProviderParameters): |
| 274 | """Delete deployed model, this api send delete command and return, it will take |
no test coverage detected