Esempio n. 1
0
    def provision(self, requester_nsa, provider_nsa, session_security_attr, connection_id):

        correlation_id = client.createCorrelationId()

        def provisionRequestFailed(err):
            # invocation failed, so we error out immediately
            self.triggerCall(provider_nsa.urn(), correlation_id, 'provision', error.ProvisionError(err.getErrorMessage()))

        rd = self.addCall(provider_nsa, correlation_id, 'provision')
        cd = self.provider_client.provision(correlation_id, requester_nsa, provider_nsa, session_security_attr, connection_id)
        cd.addErrback(provisionRequestFailed)
        return rd
Esempio n. 2
0
    def query(self, requester_nsa, provider_nsa, session_security_attr, operation='Summary', connection_ids=None, global_reservation_ids=None):

        correlation_id = client.createCorrelationId()

        def queryRequestFailed(err):
            # invocation failed, so we error out immediately
            self.triggerCall(provider_nsa.urn(), correlation_id, 'query', error.QueryError(err.getErrorMessage()))

        rd = self.addCall(provider_nsa, correlation_id, 'query')
        cd = self.provider_client.query(correlation_id, requester_nsa, provider_nsa, session_security_attr, operation, connection_ids, global_reservation_ids)
        cd.addErrback(queryRequestFailed)
        return rd
Esempio n. 3
0
    def reserve(self, requester_nsa, provider_nsa, session_security_attr, global_reservation_id, description, connection_id, service_parameters):

        correlation_id = client.createCorrelationId()

        def reserveRequestFailed(err):
            # invocation failed, so we error out immediately
            log.msg('Reserve invocation failed: %s' % str(err))
            self.triggerCall(provider_nsa.urn(), correlation_id, 'reserve', error.ReserveError(err.getErrorMessage()))

        rd = self.addCall(provider_nsa, correlation_id, 'reserve')
        cd = self.provider_client.reserve(correlation_id, requester_nsa, provider_nsa, session_security_attr,
                                          global_reservation_id, description, connection_id, service_parameters)
        cd.addErrback(reserveRequestFailed)
        return rd
Esempio n. 4
0
    def release(self, requester_nsa, provider_nsa, session_security_attr,
                connection_id):

        correlation_id = client.createCorrelationId()

        def releaseRequestFailed(err):
            # invocation failed, so we error out immediately
            self.triggerCall(provider_nsa.urn(), correlation_id, 'release',
                             error.ReleaseError(err.getErrorMessage()))

        rd = self.addCall(provider_nsa, correlation_id, 'release')
        cd = self.provider_client.release(correlation_id, requester_nsa,
                                          provider_nsa, session_security_attr,
                                          connection_id)
        cd.addErrback(releaseRequestFailed)
        return rd
Esempio n. 5
0
    def reserve(self, requester_nsa, provider_nsa, session_security_attr,
                global_reservation_id, description, connection_id,
                service_parameters):

        correlation_id = client.createCorrelationId()

        def reserveRequestFailed(err):
            # invocation failed, so we error out immediately
            log.msg('Reserve invocation failed: %s' % str(err))
            self.triggerCall(provider_nsa.urn(), correlation_id, 'reserve',
                             error.ReserveError(err.getErrorMessage()))

        rd = self.addCall(provider_nsa, correlation_id, 'reserve')
        cd = self.provider_client.reserve(correlation_id, requester_nsa,
                                          provider_nsa, session_security_attr,
                                          global_reservation_id, description,
                                          connection_id, service_parameters)
        cd.addErrback(reserveRequestFailed)
        return rd
Esempio n. 6
0
    def query(self,
              requester_nsa,
              provider_nsa,
              session_security_attr,
              operation='Summary',
              connection_ids=None,
              global_reservation_ids=None):

        correlation_id = client.createCorrelationId()

        def queryRequestFailed(err):
            # invocation failed, so we error out immediately
            self.triggerCall(provider_nsa.urn(), correlation_id, 'query',
                             error.QueryError(err.getErrorMessage()))

        rd = self.addCall(provider_nsa, correlation_id, 'query')
        cd = self.provider_client.query(correlation_id, requester_nsa,
                                        provider_nsa, session_security_attr,
                                        operation, connection_ids,
                                        global_reservation_ids)
        cd.addErrback(queryRequestFailed)
        return rd