My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USERNAME [a-zA-Z0-9._-]+ | |
| USER %{USERNAME} | |
| EMAILLOCALPART [a-zA-Z0-9!#$%&'*+\-/=?^_`{|}~]{1,64}(?:\.[a-zA-Z0-9!#$%&'*+\-/=?^_`{|}~]{1,62}){0,63} | |
| EMAILADDRESS %{EMAILLOCALPART}@%{HOSTNAME} | |
| INT (?:[+-]?(?:[0-9]+)) | |
| BASE10NUM (?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+))) | |
| NUMBER (?:%{BASE10NUM}) | |
| BASE16NUM (?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+)) | |
| BASE16FLOAT \b(?<![0-9A-Fa-f.])(?:[+-]?(?:0x)?(?:(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?)|(?:\.[0-9A-Fa-f]+)))\b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hudson.model.* | |
| for (aSlave in hudson.model.Hudson.instance.nodes) { | |
| if (aSlave.name ==~ /.*<slave name>.*/) { | |
| println('Shutting down node '+aSlave.name); | |
| hudson.model.Hudson.instance.removeNode(aSlave); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| from ansible.module_utils.basic import AnsibleModule | |
| from zeep import Client as Client, Transport | |
| import urllib3 | |
| import time | |
| urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
| com.cloudbees.plugins.credentials.Credentials.class | |
| ) | |
| for (c in creds) { | |
| println(c.id) | |
| if (c.properties.username) { | |
| println(" description: " + c.description) | |
| } | |
| if (c.properties.username) { | |
| println(" username: " + c.username) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: greeter | |
| spec: | |
| selector: | |
| matchLabels: | |
| app.kubernetes.io/name: greeter | |
| replicas: 1 | |
| template: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: iron-gallery-ingress | |
| spec: | |
| rules: | |
| - host: iron-gallery-braavos.com | |
| http: | |
| paths: | |
| - path: / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: Pod | |
| apiVersion: v1 | |
| metadata: | |
| name: simple-volume-pod | |
| spec: | |
| # Volumes are declared by the pod. They share its lifecycle | |
| # and are communal across containers. | |
| volumes: | |
| # Volumes have a name and configuration based on the type of volume. | |
| # In this example, we use the emptyDir volume type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: Service | |
| apiVersion: v1 | |
| metadata: | |
| name: hostname-service | |
| spec: | |
| # Expose the service on a static port on each node | |
| # so that we can access the service from outside the cluster | |
| type: NodePort | |
| # When the node receives a request on the static port (30163) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: Pod | |
| apiVersion: v1 | |
| metadata: | |
| name: pod-env-var | |
| spec: | |
| containers: | |
| - name: env-var-configmap | |
| image: nginx:1.7.9 | |
| envFrom: | |
| - configMapRef: |
NewerOlder