2014-08-11 22:34:30 +02:00
|
|
|
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
|
|
|
|
# All Rights Reserved.
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
|
|
|
|
class OperationResult(object):
|
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
result_status,
|
|
|
|
result_reason=None,
|
|
|
|
result_message=None):
|
|
|
|
self.result_status = result_status
|
|
|
|
|
|
|
|
if result_reason is not None:
|
|
|
|
self.result_reason = result_reason
|
|
|
|
else:
|
|
|
|
self.result_reason = None
|
|
|
|
|
|
|
|
if result_message is not None:
|
|
|
|
self.result_message = result_message
|
|
|
|
else:
|
|
|
|
self.result_message = None
|
|
|
|
|
|
|
|
|
|
|
|
class CreateResult(OperationResult):
|
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
result_status,
|
|
|
|
result_reason=None,
|
|
|
|
result_message=None,
|
|
|
|
object_type=None,
|
|
|
|
uuid=None,
|
|
|
|
template_attribute=None):
|
|
|
|
super(self.__class__, self).__init__(result_status,
|
|
|
|
result_reason,
|
|
|
|
result_message)
|
|
|
|
if object_type is not None:
|
|
|
|
self.object_type = object_type
|
|
|
|
else:
|
|
|
|
self.object_type = None
|
|
|
|
|
|
|
|
if uuid is not None:
|
|
|
|
self.uuid = uuid
|
|
|
|
else:
|
|
|
|
self.uuid = None
|
|
|
|
|
|
|
|
if template_attribute is not None:
|
|
|
|
self.template_attribute = template_attribute
|
|
|
|
else:
|
|
|
|
self.template_attribute = None
|
|
|
|
|
|
|
|
|
2015-01-09 19:11:05 +01:00
|
|
|
class CreateKeyPairResult(OperationResult):
|
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
result_status,
|
|
|
|
result_reason=None,
|
|
|
|
result_message=None,
|
|
|
|
private_key_uuid=None,
|
|
|
|
public_key_uuid=None,
|
|
|
|
private_key_template_attribute=None,
|
|
|
|
public_key_template_attribute=None):
|
2015-01-19 15:37:32 +01:00
|
|
|
super(CreateKeyPairResult, self).__init__(
|
|
|
|
result_status, result_reason, result_message)
|
2015-01-09 19:11:05 +01:00
|
|
|
self.private_key_uuid = private_key_uuid
|
|
|
|
self.public_key_uuid = public_key_uuid
|
|
|
|
self.private_key_template_attribute = private_key_template_attribute
|
|
|
|
self.public_key_template_attribute = public_key_template_attribute
|
|
|
|
|
|
|
|
|
2014-08-11 22:34:30 +02:00
|
|
|
class RegisterResult(OperationResult):
|
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
result_status,
|
|
|
|
result_reason=None,
|
|
|
|
result_message=None,
|
|
|
|
uuid=None,
|
|
|
|
template_attribute=None):
|
|
|
|
super(self.__class__, self).__init__(result_status,
|
|
|
|
result_reason,
|
|
|
|
result_message)
|
|
|
|
if uuid is not None:
|
|
|
|
self.uuid = uuid
|
|
|
|
else:
|
|
|
|
self.uuid = None
|
|
|
|
|
|
|
|
if template_attribute is not None:
|
|
|
|
self.template_attribute = template_attribute
|
|
|
|
else:
|
|
|
|
self.template_attribute = None
|
|
|
|
|
|
|
|
|
2015-01-21 17:41:08 +01:00
|
|
|
class RekeyKeyPairResult(CreateKeyPairResult):
|
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
result_status,
|
|
|
|
result_reason=None,
|
|
|
|
result_message=None,
|
|
|
|
private_key_uuid=None,
|
|
|
|
public_key_uuid=None,
|
|
|
|
private_key_template_attribute=None,
|
|
|
|
public_key_template_attribute=None):
|
|
|
|
super(RekeyKeyPairResult, self).__init__(
|
|
|
|
result_status, result_reason, result_message, private_key_uuid,
|
|
|
|
public_key_uuid, private_key_template_attribute,
|
|
|
|
public_key_template_attribute)
|
|
|
|
|
|
|
|
|
2014-08-11 22:34:30 +02:00
|
|
|
class GetResult(OperationResult):
|
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
result_status,
|
|
|
|
result_reason=None,
|
|
|
|
result_message=None,
|
|
|
|
object_type=None,
|
|
|
|
uuid=None,
|
|
|
|
secret=None):
|
|
|
|
super(self.__class__, self).__init__(result_status,
|
|
|
|
result_reason,
|
|
|
|
result_message)
|
|
|
|
if object_type is not None:
|
|
|
|
self.object_type = object_type
|
|
|
|
else:
|
|
|
|
self.object_type = None
|
|
|
|
|
|
|
|
if uuid is not None:
|
|
|
|
self.uuid = uuid
|
|
|
|
else:
|
|
|
|
self.uuid = None
|
|
|
|
|
|
|
|
if secret is not None:
|
|
|
|
self.secret = secret
|
|
|
|
else:
|
|
|
|
self.secret = None
|
|
|
|
|
|
|
|
|
|
|
|
class DestroyResult(OperationResult):
|
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
result_status,
|
|
|
|
result_reason=None,
|
|
|
|
result_message=None,
|
|
|
|
uuid=None):
|
|
|
|
super(self.__class__, self).__init__(result_status,
|
|
|
|
result_reason,
|
|
|
|
result_message)
|
|
|
|
if uuid is not None:
|
|
|
|
self.uuid = uuid
|
|
|
|
else:
|
|
|
|
self.uuid = None
|
2014-09-04 20:42:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
class LocateResult(OperationResult):
|
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
result_status,
|
|
|
|
result_reason=None,
|
|
|
|
result_message=None,
|
2014-09-09 06:14:02 +02:00
|
|
|
uuids=None):
|
2014-09-04 20:42:20 +02:00
|
|
|
super(self.__class__, self).__init__(result_status,
|
|
|
|
result_reason,
|
|
|
|
result_message)
|
2014-09-09 06:14:02 +02:00
|
|
|
self.uuids = uuids
|