|
53 | 53 | Offer, |
54 | 54 | OfferOptionRequest, |
55 | 55 | ResetHostingPasswordResponse, |
| 56 | + ResourceSummary, |
56 | 57 | Session, |
57 | 58 | Website, |
58 | 59 | ) |
|
74 | 75 | unmarshal_ListOffersResponse, |
75 | 76 | unmarshal_ListWebsitesResponse, |
76 | 77 | unmarshal_ResetHostingPasswordResponse, |
| 78 | + unmarshal_ResourceSummary, |
77 | 79 | unmarshal_Session, |
78 | 80 | marshal_DatabaseApiAssignDatabaseUserRequest, |
79 | 81 | marshal_DatabaseApiChangeDatabaseUserPasswordRequest, |
@@ -1228,6 +1230,39 @@ async def reset_hosting_password( |
1228 | 1230 | self._throw_on_error(res) |
1229 | 1231 | return unmarshal_ResetHostingPasswordResponse(res.json()) |
1230 | 1232 |
|
| 1233 | + async def get_resource_summary( |
| 1234 | + self, |
| 1235 | + *, |
| 1236 | + hosting_id: str, |
| 1237 | + region: Optional[Region] = None, |
| 1238 | + ) -> ResourceSummary: |
| 1239 | + """ |
| 1240 | + Get the total counts of websites, databases, email accounts, and FTP accounts of a Web Hosting plan. |
| 1241 | + :param hosting_id: Hosting ID. |
| 1242 | + :param region: Region to target. If none is passed will use default region from the config. |
| 1243 | + :return: :class:`ResourceSummary <ResourceSummary>` |
| 1244 | +
|
| 1245 | + Usage: |
| 1246 | + :: |
| 1247 | +
|
| 1248 | + result = await api.get_resource_summary( |
| 1249 | + hosting_id="example", |
| 1250 | + ) |
| 1251 | + """ |
| 1252 | + |
| 1253 | + param_region = validate_path_param( |
| 1254 | + "region", region or self.client.default_region |
| 1255 | + ) |
| 1256 | + param_hosting_id = validate_path_param("hosting_id", hosting_id) |
| 1257 | + |
| 1258 | + res = self._request( |
| 1259 | + "GET", |
| 1260 | + f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/resource-summary", |
| 1261 | + ) |
| 1262 | + |
| 1263 | + self._throw_on_error(res) |
| 1264 | + return unmarshal_ResourceSummary(res.json()) |
| 1265 | + |
1231 | 1266 |
|
1232 | 1267 | class WebhostingV1FtpAccountAPI(API): |
1233 | 1268 | """ |
|
0 commit comments