Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class ScriptSerializer(serialize.QuerySerializer):
def serialize_to_request(self, parameters, operation_model):
serialized = super(ScriptSerializer, self).serialize_to_request(
parameters, operation_model
)
target = '%s.%s' % (operation_model.metadata['targetPrefix'],
operation_model.name)
serialized['headers']['X-Amz-Target'] = target
serialized['url_path'] = operation_model.http.get('requestUri', '/')
del serialized['body']['Action']
del serialized['body']['Version']
return serialized
serialize.SERIALIZERS.update({
'computing': ComputingSerializer,
'script': ScriptSerializer
})
def serialize_to_request(self, parameters, operation_model):
serialized = super(ComputingSerializer, self).serialize_to_request(
parameters, operation_model
)
serialized['url_path'] = operation_model.http.get('requestUri', '/')
# Fix request parameters of DescribeLoadBalancers for NIFCLOUD
if operation_model.name == 'DescribeLoadBalancers':
serialized["body"] = self._fix_describe_load_balancers_params(
parameters, operation_model.metadata['apiVersion']
)
return serialized
def serialize_to_request(self, parameters, operation_model):
serialized = super(ScriptSerializer, self).serialize_to_request(
parameters, operation_model
)
target = '%s.%s' % (operation_model.metadata['targetPrefix'],
operation_model.name)
serialized['headers']['X-Amz-Target'] = target
serialized['url_path'] = operation_model.http.get('requestUri', '/')
del serialized['body']['Action']
del serialized['body']['Version']
return serialized
def serialize_to_request(self, parameters, operation_model):
serialized = super(ScriptSerializer, self).serialize_to_request(
parameters, operation_model
)
target = '%s.%s' % (operation_model.metadata['targetPrefix'],
operation_model.name)
serialized['headers']['X-Amz-Target'] = target
serialized['url_path'] = operation_model.http.get('requestUri', '/')
del serialized['body']['Action']
del serialized['body']['Version']
return serialized
serialize.SERIALIZERS.update({
'computing': ComputingSerializer,
'script': ScriptSerializer
})
import nifcloud
class Session(session.Session):
def __init__(self, session_vars=None, event_hooks=None,
include_builtin_handlers=True, profile=None):
super(Session, self).__init__(session_vars, event_hooks,
include_builtin_handlers, profile)
self.user_agent_name = 'nifcloud'
self.user_agent_version = nifcloud.__version__
self.user_agent_extra = 'botocore/%s' % botocore_version
session.Session = Session
def __init__(self, session_vars=None, event_hooks=None,
include_builtin_handlers=True, profile=None):
super(Session, self).__init__(session_vars, event_hooks,
include_builtin_handlers, profile)
self.user_agent_name = 'nifcloud'
self.user_agent_version = nifcloud.__version__
self.user_agent_extra = 'botocore/%s' % botocore_version
def __init__(self, session_vars=None, event_hooks=None,
include_builtin_handlers=True, profile=None):
super(Session, self).__init__(session_vars, event_hooks,
include_builtin_handlers, profile)
self.user_agent_name = 'nifcloud'
self.user_agent_version = nifcloud.__version__
self.user_agent_extra = 'botocore/%s' % botocore_version
replace = r"\1<%s/script/start.htm>\2" % (NIFCLOUD_DOC_BASE)
else:
replace = r"\1<%s/%s/%s.htm>\2" % (NIFCLOUD_DOC_BASE,
self._service_name,
operation_name)
method_intro = section.get_section('method-intro')
replaced_text = re.sub(
r"([\s\S]+)<.+>(.+)$",
replace,
method_intro.getvalue().decode('utf8')
).replace('AWS', 'NIFCLOUD')
method_intro.clear_text()
method_intro.push_write(replaced_text)
service.ClientDocumenter = ClientDocumenter
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
from nifcloud import __version__
from nifcloud.docs import generate_docs
from nifcloud.session import get_session
generate_docs(os.path.dirname(os.path.abspath(__file__)), get_session())
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []