示例#1
0
def _extract_rule(core_service_tuple: CoreConfig, config: Dict, secure: bool) -> OrchestrationRule:
    secure_string = constants.Security.SECURE if secure else constants.Security.INSECURE
    access_policy = constants.AccessPolicy.CERTIFICATE if secure else constants.AccessPolicy.UNRESTRICTED
    interface = ServiceInterface(core_service_tuple.protocol, secure_string, core_service_tuple.payload)
    core_system = ArrowheadSystem(**config[core_service_tuple.system])
    return OrchestrationRule(
            Service(
                    core_service_tuple.service_definition,
                    core_service_tuple.uri,
                    interface,
                    access_policy,
            ),
            core_system,
            core_service_tuple.method,
    )
                        'serviceregistry/mgmt',
                        ServiceInterface.from_str('HTTP-SECURE-JSON'),
                ),
                ArrowheadSystem(
                        **default_config['service_registry']
                ),
                'POST',
        )
)

setup_client.orchestration_rules.store(
        OrchestrationRule(
                Service(
                        'mgmt_get_systems',
                        'serviceregistry/mgmt/systems',
                        ServiceInterface('HTTP', 'SECURE', 'JSON'),
                ),
                ArrowheadSystem(
                        **default_config['service_registry']
                ),
                'GET',
        )
)

setup_client.orchestration_rules.store(
        OrchestrationRule(
                Service(
                        'mgmt_register_system',
                        'serviceregistry/mgmt/systems',
                        ServiceInterface('HTTP', 'SECURE', 'JSON'),
                ),