-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add feature for DataSourceAccount (#199)
- Loading branch information
Showing
23 changed files
with
964 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/spaceone/cost_analysis/interface/grpc/data_source_account.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import logging | ||
|
||
from spaceone.api.cost_analysis.v1 import ( | ||
data_source_account_pb2, | ||
data_source_account_pb2_grpc, | ||
) | ||
from spaceone.core.pygrpc import BaseAPI | ||
|
||
from spaceone.cost_analysis.service.data_source_account_service import ( | ||
DataSourceAccountService, | ||
) | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
class DataSourceAccount( | ||
BaseAPI, data_source_account_pb2_grpc.DataSourceAccountServicer | ||
): | ||
pb2 = data_source_account_pb2 | ||
pb2_grpc = data_source_account_pb2_grpc | ||
|
||
def update(self, request, context): | ||
params, metadata = self.parse_request(request, context) | ||
data_source_account_svc = DataSourceAccountService(metadata) | ||
response: dict = data_source_account_svc.update(params) | ||
return self.dict_to_message(response) | ||
|
||
def reset(self, request, context): | ||
params, metadata = self.parse_request(request, context) | ||
data_source_account_svc = DataSourceAccountService(metadata) | ||
response: dict = data_source_account_svc.reset(params) | ||
return self.dict_to_message(response) | ||
|
||
def get(self, request, context): | ||
params, metadata = self.parse_request(request, context) | ||
data_source_account_svc = DataSourceAccountService(metadata) | ||
response: dict = data_source_account_svc.get(params) | ||
return self.dict_to_message(response) | ||
|
||
def list(self, request, context): | ||
params, metadata = self.parse_request(request, context) | ||
data_source_account_svc = DataSourceAccountService(metadata) | ||
response: dict = data_source_account_svc.list(params) | ||
return self.dict_to_message(response) | ||
|
||
def stat(self, request, context): | ||
params, metadata = self.parse_request(request, context) | ||
data_source_account_svc = DataSourceAccountService(metadata) | ||
response: dict = data_source_account_svc.stat(params) | ||
return self.dict_to_message(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.