Initial commit
[ta/distributed-state-server.git] / src / dss / api / dss_delete_rpc.py
1 # Copyright 2019 Nokia
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15
16 '''
17 Delete RPC
18 Req:
19     {
20         "domain": <domain name>,
21         "name": <the attribute name>
22     }
23
24 Reply:
25 {}
26 '''
27 class DeleteRPC(object):
28     @staticmethod
29     def get_name():
30         return "delete"
31
32     @staticmethod
33     def create_req_payload(domain, name):
34         payload = {}
35         payload['domain'] = domain
36         payload['name'] = name
37         return payload
38
39     @staticmethod
40     def get_domain_from_req_payload(payload):
41         return payload['domain']
42
43     @staticmethod
44     def get_name_from_req_payload(payload):
45         return payload['name']