Skip to content

Blueprint Cheat Sheet

Al Beebe edited this page Nov 2, 2015 · 54 revisions
Microservices
Client

Microservice that doesn't send a response

microservice {

  description "Create a widget"
  uri "microservice:///example/v1/create/widget"

}

Microservice that sends a single response

microservice {

  description "Get a widget"
  uri "microservice:///example/v1/get/widget"

  response {
    description "Successfully received a widget back"
    uri "resource:///example/reply/widget-instance"
  }

}

Microservice that can send more then one response

microservice {

  description "Get a widget"
  uri "microservice:///example/v1/get/widget"

  response {
    description "Successfully received a widget back"
    uri "resource:///example/reply/widget-instance"
  }

  response {
    description "Failed to get a widget"
    uri "resource:///example/reply/error"
  }

}

Microservice that can receive sub requests

microservice {

  description "Get a widget"
  uri "microservice:///example/v1/get/widget"

  request {
    description "Abort getting the original widget and get a different one"
    uri "resource:///example/get/widget"
  }

  response {
    description "Successfully received a widget back"
    uri "resource:///example/reply/widget-instance"
  }

  response {
    description "Failed to get a widget"
    uri "resource:///example/reply/error"
  }

}

Override the context and payload the client sends to the microservice

microservice {

  description "Get a widget"
  uri "microservice:///example/v1/get/widget"
  context {
    package "example"
    object "new-context"
  }
  payload {
    package "example"
    object "widget-lookup"
  }

  response {
    description "Successfully received a widget back"
    uri "resource:///example/reply/widget-instance"
  }

  response {
    description "Failed to get a widget"
    uri "resource:///example/reply/error"
  }

}

Override the context and payload the microservice sends to the client

microservice {

  description "Get a widget"
  uri "microservice:///example/v1/get/widget"

  response {
    description "Successfully received a widget back"
    uri "resource:///example/reply/widget"
    context {
      package "example"
      object "new-context"
    }
    payload {
      package "example"
      object "widget-instance"
    }
  }

  response {
    description "Failed to get a widget"
    uri "resource:///example/reply/error"
  }

}

Client request that doesn't return a response

client {

  description "A new widget was received"
  uri "client:///example/v1/new/widget"

}

Client request that returns a single response

client {

  description "A new widget was received"
  uri "client:///example/v1/new/widget"

  response {
    description "Confirm the widget was received"
    uri "resource:///example/received/widget"
  }

}

Client request that can send more then one response

client {

  description "A new widget was received"
  uri "client:///example/v1/new/widget"

  response {
    description "Confirm the widget was received"
    uri "resource:///example/received/widget"
  }

  response {
    description "Reply with an error"
    uri "resource:///example/reply/error"
  }

}

Client request that can receive sub requests

client {

  description "A new widget was received"
  uri "client:///example/v1/new/widget"

  request {
    description "Kiss the widget that was just received"
    uri "resource:///example/kiss/widget"
  }

  response {
    description "Confirm the widget was kissed"
    uri "resource:///example/kissed/widget"
  }

  response {
    description "Confirm the widget was received"
    uri "resource:///example/received/widget"
  }

  response {
    description "Reply with an error"
    uri "resource:///example/reply/error"
  }

}
Clone this wiki locally