Ejemplo n.º 1
0
 def stop_flow(self, flow_arn):
     if flow_arn in self._flows:
         flow = self._flows[flow_arn]
         flow.status = "STOPPING"
     else:
         raise NotFoundException(message="Flow not found.")
     return flow_arn, flow.status
Ejemplo n.º 2
0
 def delete_flow(self, flow_arn):
     if flow_arn in self._flows:
         flow = self._flows[flow_arn]
         del self._flows[flow_arn]
     else:
         raise NotFoundException(message="Flow not found.")
     return flow_arn, flow.status
Ejemplo n.º 3
0
 def add_flow_outputs(self, flow_arn, outputs):
     if flow_arn in self._flows:
         flow = self._flows[flow_arn]
         flow.outputs = outputs
     else:
         raise NotFoundException(
             message="flow with arn={} not found".format(flow_arn))
     return flow_arn, flow.outputs
Ejemplo n.º 4
0
 def add_flow_vpc_interfaces(self, flow_arn, vpc_interfaces):
     if flow_arn in self._flows:
         flow = self._flows[flow_arn]
         flow.vpc_interfaces = vpc_interfaces
     else:
         raise NotFoundException(
             message="flow with arn={} not found".format(flow_arn))
     return flow_arn, flow.vpc_interfaces
Ejemplo n.º 5
0
 def describe_flow(self, flow_arn=None):
     messages = {}
     if flow_arn in self._flows:
         flow = self._flows[flow_arn]
         flow.resolve_transient_states()
     else:
         raise NotFoundException(message="Flow not found.")
     return flow.to_dict(), messages
Ejemplo n.º 6
0
 def remove_flow_output(self, flow_arn, output_name):
     if flow_arn in self._flows:
         flow = self._flows[flow_arn]
         flow.outputs = [
             output for output in self._flows[flow_arn].outputs
             if output["name"] != output_name
         ]
     else:
         raise NotFoundException(
             message="flow with arn={} not found".format(flow_arn))
     return flow_arn, output_name
Ejemplo n.º 7
0
 def remove_flow_vpc_interface(self, flow_arn, vpc_interface_name):
     if flow_arn in self._flows:
         flow = self._flows[flow_arn]
         flow.vpc_interfaces = [
             vpc_interface
             for vpc_interface in self._flows[flow_arn].vpc_interfaces
             if vpc_interface["name"] != vpc_interface_name
         ]
     else:
         raise NotFoundException(
             message="flow with arn={} not found".format(flow_arn))
     return flow_arn, vpc_interface_name
Ejemplo n.º 8
0
 def list_tags_for_resource(self, resource_arn):
     if resource_arn in self._resources:
         resource = self._resources[resource_arn]
     else:
         raise NotFoundException(message="Resource not found.")
     return resource.tags