Target: 33333333333333333333333333333333
Access key: 1111111111111111111111111111111111111111
Secret key: 2222222222222222222222222222222222222222
URL: https://vws.vuforia.com/targets/33333333333333333333333333333333/instances
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: metricbeat-config | |
namespace: kube-system | |
labels: | |
k8s-app: metricbeat | |
data: | |
metricbeat.yml: |- |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: my-kube-secret-name | |
type: Opaque | |
data: | |
username: base64-encoded-username-here | |
password: base64-encoded-password-here |
initContainers: | |
- image: redriversoftware/sql-azure-firewall-opener:latest | |
name: sql-azure-firewall-opener | |
env: | |
- name: username | |
valueFrom: | |
secretKeyRef: | |
name: my-kube-secret-name | |
key: username | |
- name: password |
// the attribute itself - to put against our action parameters. | |
// combines the model binding engine with our value provider factory. | |
public class FromHeaderAttribute : ParameterBindingAttribute | |
{ | |
public override HttpParameterBinding GetBinding(HttpParameterDescriptor parameter) | |
{ | |
var httpConfig = parameter.Configuration; | |
var binder = new ModelBinderAttribute() | |
.GetModelBinder(httpConfig, parameter.ParameterType); | |
return new ModelBinderParameterBinding( |
[HttpGet] | |
[Route("products")] | |
public IHttpActionResult GetProducts([FromUri]string filter, [FromHeader]StandardGetHeaders headers) | |
{ | |
// validate headers (and any other bound fields), returning useful messages | |
// upon failure | |
if (!ModelState.IsValid) return BadRequest(ModelState); | |
// run our query | |
var results = RunGetProductsQuery( |
[HttpGet] | |
[Route("products")] | |
public IHttpActionResult GetProducts([FromUri]string filter) | |
{ | |
string headerValue = null; | |
IEnumerable headerValues; | |
if (Request.Headers.TryGetValue("X-Secret-Penguin-Handshake", out headerValues)) | |
{ | |
headerValue = headerValues.FirstOrDefault(); | |
} |
public class MyLimitedApiClient | |
{ | |
private static readonly object _syncRoot = new object(); | |
private DateTime? _nextRequestTimeSlot = null; | |
private readonly HttpClient _http; | |
private static readonly TimeSpan RateLimitedInterval = TimeSpan.FromSeconds(0.1); // 10 per sec | |
public async Task<T> GetJson<T>(string url) where T : class | |
{ |
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "v1", | |
"title": "API" | |
}, | |
"basePath": "\/", | |
"paths": { | |
"\/categories": { | |
"get": { |
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "v1", | |
"title": "API" | |
}, | |
"basePath": "\/", | |
"paths": { | |
"\/categories": { | |
"get": { |