save or update this container in Ariane Server
        :return:

def save(self):
        """
        save or update this container in Ariane Server
        :return:
        """
        LOGGER.debug("Container.save")
        if self.cluster is not None:
            if self.cluster.id is None:
                self.cluster.save()
            self.cluster_id = self.cluster.id

        if self.parent_container is not None:
            if self.parent_container.id is None:
                self.parent_container.save()
            self.parent_container_id = self.parent_container.id

        if self.primary_admin_gate is not None:
            if self.primary_admin_gate.id is None:
                self.primary_admin_gate.save()
            self.primary_admin_gate_id = self.primary_admin_gate.id

        post_payload = {}
        consolidated_child_containers_id = []
        consolidated_child_nodes_id = []
        consolidated_child_gates_id = []
        consolidated_properties = {}
        consolidated_container_properties = []

        if self.id is not None:
            post_payload['containerID'] = self.id

        if self.name is not None:
            post_payload['containerName'] = self.name

        if self.company is not None:
            post_payload['containerCompany'] = self.company

        if self.product is not None:
            post_payload['containerProduct'] = self.product

        if self.type is not None:
            post_payload['containerType'] = self.type

        if self.primary_admin_gate_id is not None:
            post_payload['containerPrimaryAdminGateID'] = self.primary_admin_gate_id

        if self.primary_admin_gate_name is not None:
            post_payload['containerGateName'] = self.primary_admin_gate_name

        if self.gate_uri is not None:
            post_payload['containerGateURI'] = self.gate_uri

        if self.cluster_id is not None:
            post_payload['containerClusterID'] = self.cluster_id

        if self.parent_container_id is not None:
            post_payload['containerParentContainerID'] = self.parent_container_id

        if self.child_containers_id is not None:
            consolidated_child_containers_id = copy.deepcopy(self.child_containers_id)
        if self.child_containers_2_rm is not None:
            for child_container_2_rm in self.child_containers_2_rm:
                if child_container_2_rm.id is None:
                    child_container_2_rm.sync()
                consolidated_child_containers_id.remove(child_container_2_rm.id)
        if self.child_containers_2_add is not None:
            for child_container_2_add in self.child_containers_2_add:
                if child_container_2_add.id is None:
                    child_container_2_add.save()
                consolidated_child_containers_id.append(child_container_2_add.id)
        post_payload['containerChildContainersID'] = consolidated_child_containers_id

        if self.gates_id is not None:
            consolidated_child_gates_id = copy.deepcopy(self.gates_id)
        if self.gates_2_rm is not None:
            for gate_2_rm in self.gates_2_rm:
                if gate_2_rm.id is None:
                    gate_2_rm.sync()
                consolidated_child_gates_id.remove(gate_2_rm.id)
        if self.gates_2_add is not None:
            for gate_2_add in self.gates_2_add:
                if gate_2_add.id is None:
                    gate_2_add.sync()
                consolidated_child_gates_id.append(gate_2_add.id)
        post_payload['containerGatesID'] = consolidated_child_gates_id

        if self.nodes_id is not None:
            consolidated_child_nodes_id = copy.deepcopy(self.nodes_id)
        if self.nodes_2_rm is not None:
            for node_2_rm in self.nodes_2_rm:
                if node_2_rm.id is None:
                    node_2_rm.sync()
                consolidated_child_nodes_id.remove(node_2_rm.id)
        if self.nodes_2_add is not None:
            for node_2_add in self.nodes_2_add:
                if node_2_add.id is None:
                    node_2_add.sync()
                consolidated_child_nodes_id.append(node_2_add.id)
        post_payload['containerNodesID'] = consolidated_child_nodes_id

        if self.properties is not None:
            consolidated_properties = copy.deepcopy(self.properties)
        if self.properties_2_rm is not None:
            for n_property_name in self.properties_2_rm:
                consolidated_properties.pop(n_property_name, 0)
        if self.properties_2_add is not None:
            for n_property_tuple in self.properties_2_add:
                consolidated_properties[n_property_tuple[0]] = n_property_tuple[1]
        if consolidated_properties.__len__() > 0:
            for key, value in consolidated_properties.items():
                consolidated_container_properties.append(DriverTools.property_params(key, value))
        post_payload['containerProperties'] = consolidated_container_properties

        params = SessionService.complete_transactional_req({'payload': json.dumps(post_payload)})
        if MappingService.driver_type != DriverFactory.DRIVER_REST:
            params['OPERATION'] = 'createContainer'
            args = {'properties': params}
            pass
        else:
            args = {
                'http_operation': 'POST',
                'operation_path': '',
                'parameters': params
            }

        response = ContainerService.requester.call(args)

        if MappingService.driver_type != DriverFactory.DRIVER_REST:
            response = response.get()

        if response.rc != 0:
            LOGGER.warning('Container.save - Problem while saving container' + self.name +
                           '. Reason: ' + str(response.response_content) + ' - ' + str(response.error_message) +
                           " (" + str(response.rc) + ")")
            if response.rc == 500 and ArianeMappingOverloadError.ERROR_MSG in response.error_message:
                raise ArianeMappingOverloadError("Container.save",
                                                 ArianeMappingOverloadError.ERROR_MSG)
            # traceback.print_stack()
        else:
            self.id = response.response_content['containerID']
            if self.child_containers_2_add is not None:
                for child_container_2_add in self.child_containers_2_add:
                    child_container_2_add.sync()
            if self.child_containers_2_rm is not None:
                for child_container_2_rm in self.child_containers_2_rm:
                    child_container_2_rm.sync()
            if self.nodes_2_add is not None:
                for node_2_add in self.nodes_2_add:
                    node_2_add.sync()
            if self.nodes_2_rm is not None:
                for node_2_rm in self.nodes_2_rm:
                    node_2_rm.sync()
            if self.gates_2_add is not None:
                for gate_2_add in self.gates_2_add:
                    gate_2_add.sync()
            if self.gates_2_rm is not None:
                for gate_2_rm in self.gates_2_rm:
                    gate_2_rm.sync()
            if self.parent_container is not None:
                self.parent_container.sync()
            if self.primary_admin_gate is not None:
                self.primary_admin_gate.sync()
            if self.cluster is not None:
                self.cluster.sync()
            self.sync(json_obj=response.response_content)
        self.child_containers_2_add.clear()
        self.child_containers_2_rm.clear()
        self.nodes_2_add.clear()
        self.nodes_2_rm.clear()
        self.gates_2_add.clear()
        self.gates_2_rm.clear()
        self.properties_2_add.clear()
        self.properties_2_rm.clear()