def test_create_all_optionals(self): installation_location = 'https://localhost:8443/sqlfire/v1/groups/2/installations/3/' location = 'https://localhost:8443/sqlfire/v1/groups/0/locator-instances/' self._return_location( 'https://localhost:8443/sqlfire/v1/groups/2/locator-instances/4/') instance = LocatorInstances(self._client, location).create( Installation(self._client, installation_location), 'example', 'bind.address', 'client.bind.address', 1234, '256M', ['-Da=alpha'], '512M', 'peer.discovery.address', 2345, True) self.assertIsInstance(instance, LocatorInstance) self._assert_post( location, { 'name': 'example', 'installation': installation_location, 'bind-address': 'bind.address', 'client-bind-address': 'client.bind.address', 'client-port': 1234, 'initial-heap': '256M', 'jvm-options': ['-Da=alpha'], 'max-heap': '512M', 'peer-discovery-address': 'peer.discovery.address', 'peer-discovery-port': 2345, 'run-netserver': True }, 'locator-group-instance')
def test_create_all_optionals(self): installation_location = 'https://localhost:8443/sqlfire/v1/groups/2/installations/3/' location = 'https://localhost:8443/sqlfire/v1/groups/0/server-instances/' self._return_location( 'https://localhost:8443/sqlfire/v1/groups/2/server-instances/4/') instance = ServerInstances(self._client, location).create( Installation(self._client, installation_location), 'example', 'bind.address', 'client.bind.address', 1234, 90, '-Xmx512M', ['-Da=alpha'], '-Xmx1024M', True) self.assertIsInstance(instance, ServerInstance) self._assert_post( location, { 'name': 'example', 'installation': installation_location, 'bind-address': 'bind.address', 'client-bind-address': 'client.bind.address', 'client-port': 1234, 'critical-heap-percentage': 90, 'initial-heap': '-Xmx512M', 'jvm-options': ['-Da=alpha'], 'max-heap': '-Xmx1024M', 'run-netserver': True }, 'server-group-instance')
def test_detail(self): self._assert_item( Installation( self._client, 'https://localhost:8443/sqlfire/v1/groups/1/installations/2/'), [('version', '6.6.1'), ('group', lambda actual: self.assertIsInstance(actual, Group)), ('agent_instances', [ AgentInstance( self._client, 'https://localhost:8443/sqlfire/v1/groups/1/agent-instances/3/' ) ]), ('installation_image', lambda actual: self.assertIsInstance(actual, InstallationImage)), ('locator_instances', [ LocatorInstance( self._client, 'https://localhost:8443/sqlfire/v1/groups/1/locator-instances/6/' ), LocatorInstance( self._client, 'https://localhost:8443/sqlfire/v1/groups/1/locator-instances/5/' ) ]), ('server_instances', [ ServerInstance( self._client, 'https://localhost:8443/sqlfire/v1/groups/1/server-instances/4/' ) ])])
def test_detail(self): self._assert_item( InstallationImage( self._client, 'https://localhost:8443/sqlfire/v1/installation-images/0/'), [('size', 7340032), ('version', '6.6.1'), ('installations', [ Installation( self._client, 'https://localhost:8443/sqlfire/v1/groups/3/installations/4/' ), Installation( self._client, 'https://localhost:8443/sqlfire/v1/groups/1/installations/2/' ) ])])
def test_update_all_optionals(self): installation_location = 'https://localhost:8443/sqlfire/v1/groups/1/installations/2/' location = 'https://localhost:8443/sqlfire/v1/groups/2/agent-instances/4/' AgentInstance(self._client, location).update( Installation(self._client, installation_location), ['-Da=alpha']) self._assert_post(location, { 'installation': installation_location, 'jvm-options': ['-Da=alpha'] })
def test_create_no_optionals(self): installation_location = 'https://localhost:8443/sqlfire/v1/groups/2/installations/3/' location = 'https://localhost:8443/sqlfire/v1/groups/0/server-instances/' self._return_location( 'https://localhost:8443/sqlfire/v1/groups/2/server-instances/4/') instance = ServerInstances(self._client, location).create( Installation(self._client, installation_location), 'example') self.assertIsInstance(instance, ServerInstance) self._assert_post(location, { 'name': 'example', 'installation': installation_location }, 'server-group-instance')
def test_create(self): installation_location = 'https://localhost:8443/sqlfire/v1/groups/2/installations/3/' location = 'https://localhost:8443/sqlfire/v1/groups/0/agent-instances/' self._return_location( 'https://localhost:8443/sqlfire/v1/groups/2/agent-instances/4/') instance = AgentInstances(self._client, location).create( Installation(self._client, installation_location), 'example', ['-Da=alpha']) self.assertIsInstance(instance, AgentInstance) self._assert_post( location, { 'name': 'example', 'installation': installation_location, 'jvm-options': ['-Da=alpha'] }, 'agent-group-instance')
def test_update_all_optionals(self): installation_location = 'https://localhost:8443/sqlfire/v1/groups/2/installations/3/' location = 'https://localhost:8443/sqlfire/v1/groups/2/server-instances/4/' ServerInstance(self._client, location).update( Installation(self._client, installation_location), 'bind.address', 'client.bind.address', 1234, 90, '-Xmx512M', ['-Da=alpha'], '-Xmx1024M', True) self._assert_post( location, { 'installation': installation_location, 'bind-address': 'bind.address', 'client-bind-address': 'client.bind.address', 'client-port': 1234, 'critical-heap-percentage': 90, 'initial-heap': '-Xmx512M', 'jvm-options': ['-Da=alpha'], 'max-heap': '-Xmx1024M', 'run-netserver': True })
def test_delete(self): self._assert_deletable( Installation( self._client, 'https://localhost:8443/sqlfire/v1/groups/1/installations/2/'))