From 1d33f4c96d2b7e6dcf735abafdf69941624c277a Mon Sep 17 00:00:00 2001 From: Drew Baugher <46505179+dbbaughe@users.noreply.github.com> Date: Fri, 13 Nov 2020 10:53:55 -0800 Subject: [PATCH] Adds some http example files to worksheets to make testing easier (#321) --- worksheets/rollups/comparisons.http | 198 ++++++++++++++++ worksheets/rollups/create.http | 160 +++++++++++++ worksheets/rollups/kibana_sample_data.http | 10 + worksheets/rollups/search_test.http | 222 ++++++++++++++++++ worksheets/rollups/secured/nyc.http | 25 ++ .../rollups/secured/security_calls.http | 82 +++++++ .../rollups/secured/security_setup.http | 204 ++++++++++++++++ worksheets/rollups/unsecured/nyc.http | 21 ++ 8 files changed, 922 insertions(+) create mode 100644 worksheets/rollups/comparisons.http create mode 100644 worksheets/rollups/create.http create mode 100644 worksheets/rollups/kibana_sample_data.http create mode 100644 worksheets/rollups/search_test.http create mode 100644 worksheets/rollups/secured/nyc.http create mode 100644 worksheets/rollups/secured/security_calls.http create mode 100644 worksheets/rollups/secured/security_setup.http create mode 100644 worksheets/rollups/unsecured/nyc.http diff --git a/worksheets/rollups/comparisons.http b/worksheets/rollups/comparisons.http new file mode 100644 index 000000000..db7e2df38 --- /dev/null +++ b/worksheets/rollups/comparisons.http @@ -0,0 +1,198 @@ +### + +#21, 14, 3, 11, 24, 1, 1, 41, 14, 13 +#POST localhost:9200/nyc-taxi-data/_search +POST localhost:9200/rollup-test-index/_search +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "pickup_areas": { + "terms": { "field": "PULocationID", "size": 10, "order": { "_key": "asc" } }, + "aggs": { + "sum": { "sum": { "field": "passenger_count" } } + } + } + } +} + + +### +POST localhost:9200/rollup-test-index/_search +#POST localhost:9200/nyc-taxi-data/_search +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "pickup_areas": { + "terms": { "field": "PULocationID", "size": 1000, "order": { "_key": "asc" } }, + "aggs": { + "sum": { "sum": { "field": "passenger_count" } }, + "min": { "min": { "field": "passenger_count" } }, + "max": { "max": { "field": "passenger_count" } }, + "avg": { "avg": { "field": "passenger_count" } }, + "value_count": { "value_count": { "field": "passenger_count" } } + } + } + } +} + +### +POST localhost:9200/kibana_sample_data_ecommerce/_search +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "city": { + "terms": { + "field": "geoip.city_name", + "size": 5, + "order": {"total_sales": "desc"} + }, + "aggs": { + "total_sales": { + "sum": { + "field": "taxless_total_price" + } + } + } + } + } +} + +### +POST localhost:9200/rollup-test-index/_search +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "city": { + "terms": { + "field": "geoip.city_name", + "size": 5, + "order": {"total_sales": "desc"} + }, + "aggs": { + "total_sales": { + "sum": { + "field": "taxless_total_price" + } + } + } + } + } +} +### +DELETE localhost:9200/rollup-test-index +### +PUT localhost:9200/rollup-test-index +Content-Type: application/json + +{ + "mappings": { + "_meta" : { + "schema_version": 1, + "rollups": { + "something": {} + } + }, + "dynamic_templates" : [ + { + "strings" : { + "match_mapping_type" : "string", + "mapping" : { + "type" : "keyword" + } + } + }, + { + "date_histograms" : { + "path_match" : "*.date_histogram.*", + "mapping" : { + "type" : "date" + } + } + } + ] + }, + "settings": { + "index.opendistro.rollup_index": true + } +} +### +POST localhost:9200/kibana_sample_data_ecommerce/_search +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "city": { + "terms": { + "field": "geoip.city_name", + "size": 5, + "order": {"avg_sale_price": "desc"} + }, + "aggs": { + "avg_sale_price": { + "avg": { + "field": "taxless_total_price" + } + } + } + } + } +} + +### +POST localhost:9200/rollup-test-index/_search +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "city": { + "terms": { + "field": "geoip.city_name", + "size": 5, + "order": {"avg_sale_price": "desc"} + }, + "aggs": { + "avg_sale_price": { + "avg": { + "field": "taxless_total_price" + } + } + } + } + } +} +### + +POST localhost:9200/rollup-test-index/_search?pretty +Content-Type: application/json + +{ + "size": 10, + "sort": { "rollup.doc_count": "desc" }, + "query": { + "exists": { + "field": "taxless_total_price.sum" + } + } +} +### +POST localhost:9200/kibana_*/_search?pretty +Content-Type: application/json + +{ + "size": 0, + "query": { + "match_all": {} + }, + "aggs": {"RollupCompositeAggs":{"composite":{"size":10,"sources":[{"order_date":{"date_histogram":{"field":"order_date","missing_bucket":false,"value_type":"date","order":"asc","fixed_interval":"1h","time_zone":"America/Los_Angeles"}}},{"geoip.city_name":{"terms":{"field":"geoip.city_name","missing_bucket":false,"order":"asc"}}},{"customer_id":{"terms":{"field":"customer_id","missing_bucket":false,"order":"asc"}}},{"day_of_week":{"terms":{"field":"day_of_week","missing_bucket":false,"order":"asc"}}}]},"aggregations":{"taxless_total_price.avg":{"avg":{"field":"taxless_total_price"}},"taxless_total_price.sum":{"sum":{"field":"taxless_total_price"}},"taxless_total_price.max":{"max":{"field":"taxless_total_price"}},"taxless_total_price.min":{"min":{"field":"taxless_total_price"}},"taxless_total_price.value_count":{"value_count":{"field":"taxless_total_price"}}}}} +} +### \ No newline at end of file diff --git a/worksheets/rollups/create.http b/worksheets/rollups/create.http new file mode 100644 index 000000000..896c909ed --- /dev/null +++ b/worksheets/rollups/create.http @@ -0,0 +1,160 @@ + +PUT localhost:9200/_opendistro/_rollup/jobs/example +Content-Type: application/json + +{ + "rollup": { + "enabled": true, + "schedule": { + "interval": { + "period": 1, + "unit": "Minutes", + "start_time": {{$timestamp}} + } + }, + "last_updated_time": {{$timestamp}}, + "description": "An example rollup", + "source_index": "nyc-taxi-data", + "target_index": "rollup-test-index", + "page_size": 10, + "delay": 0, + "continuous": false, + "dimensions": [{ + "date_histogram": { + "source_field": "timestamp", + "fixed_interval": "1h" + } + }, { + "terms": { "source_field": "RatecodeID" } + }, { + "terms": { "source_field": "PULocationID" } + }], + "metrics": [{ + "source_field": "passenger_count", + "metrics": [{ "avg": {} },{ "sum": {} }, { "max": {} }, { "min": {} }, { "value_count": {} }] + }, { + "source_field": "total_amount", + "metrics": [{ "avg": {} },{ "sum": {} }, { "max": {} }, { "min": {} }, { "value_count": {} }] + }] + } +} +### +PUT localhost:9200/_opendistro/_rollup/jobs/example +Content-Type: application/json + +{ + "rollup": { + "enabled": true, + "schedule": { + "interval": { + "period": 1, + "unit": "Minutes", + "start_time": {{$timestamp}} + } + }, + "last_updated_time": {{$timestamp}}, + "description": "An example rollup", + "source_index": "test-index", + "target_index": "rollup-test-index", + "page_size": 100, + "delay": 0, + "dimensions": [{ + "date_histogram": { + "field": "@timestamp", + "fixed_interval": "1h", + "timezone": "1h" + } + }] + } +} + +### +DELETE localhost:9200/_opendistro/_rollup/jobs/example +Content-Type: application/json + +### +GET localhost:9200/_opendistro/_rollup/jobs/example +Content-Type: application/json + +### +DELETE localhost:9200/rollup-test-index + +### +GET localhost:9200/rollup-test-index/_mappings + +### +POST localhost:9200/rollup-test-index/_search + +### +POST localhost:9200/rollup-test-index/_doc +Content-Type: application/json + +{ + "hey": 1, + "updated_at": 1600381015 +} + +### +POST localhost:9200/test/_doc +Content-Type: application/json + +{ + "hey": 5, + "updated_at": 1600381015 +} + +### +POST localhost:9200/*/_search + +### +PUT localhost:9200/ok + +### +POST localhost:9200/ok/_doc +Content-Type: application/json + +{ + "ok": 5 +} + +### +GET localhost:9200/ok,two/_search +Content-Type: application/json + +{ + "query": { + "term": { + "some_random_field": { + "value": "nothing" + } + } + } +} + +### +PUT localhost:9200/_opendistro/_rollup/jobs/example/_start + +### +PUT localhost:9200/_opendistro/_rollup/jobs/example/_stop + +### +GET localhost:9200/.opendistro-ism-config/_search?pretty + +### +PUT localhost:9200/ok +### +PUT localhost:9200/two-02 +### +GET localhost:9200/ok,two*,t*,*/_search + + +### + +GET localhost:9200/rollup-test-index/_mapping/field/_meta?include_defaults=true + +### + +GET localhost:9200/rollup-test-index/_mapping + + +### diff --git a/worksheets/rollups/kibana_sample_data.http b/worksheets/rollups/kibana_sample_data.http new file mode 100644 index 000000000..8b588fd9c --- /dev/null +++ b/worksheets/rollups/kibana_sample_data.http @@ -0,0 +1,10 @@ +# This will ingest the kibana sample ecommerce data into the cluster iff kibana +# is running on 5601. If using local dev kibana make sure to pass yarn start --no-base-path +POST localhost:5601/api/sample_data/ecommerce +Connection: keep-alive +kbn-version: 7.9.1 +Accept: */* +User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36 +Content-Type: application/json +### + diff --git a/worksheets/rollups/search_test.http b/worksheets/rollups/search_test.http new file mode 100644 index 000000000..5fb4f4fc0 --- /dev/null +++ b/worksheets/rollups/search_test.http @@ -0,0 +1,222 @@ +DELETE localhost:9200/_opendistro/_rollup/jobs/example +### +PUT localhost:9200/_opendistro/_rollup/jobs/example +Content-Type: application/json + +{ + "rollup": { + "enabled": true, + "schedule": { + "interval": { + "period": 1, + "unit": "Minutes", + "start_time": {{$timestamp}} + } + }, + "last_updated_time": {{$timestamp}}, + "description": "An example policy that rolls up the sample ecommerce data", + "source_index": "kibana_sample_data_ecommerce", + "target_index": "rollup-test-index", + "page_size": 100, + "delay": 0, + "continuous": false, + "dimensions": [ + { + "date_histogram": { + "source_field": "order_date", + "fixed_interval": "1h", + "timezone": "America/Los_Angeles" + } + }, + { + "terms": { + "source_field": "geoip.city_name" + } + }, + { + "terms": { + "source_field": "customer_id" + } + }, + { + "terms": { + "source_field": "day_of_week" + } + }, + { + "terms": { + "source_field": "customer_gender" + } + } + ], + "metrics": [ + { + "source_field": "taxless_total_price", + "metrics": [{ "avg": {} },{ "sum": {} }, { "max": {} }, { "min": {} }, { "value_count": {} }] + }, + { + "source_field": "total_quantity", + "metrics": [{ "avg": {} },{ "sum": {} }, { "max": {} }, { "min": {} }, { "value_count": {} }] + } + ] + } +} + +### +POST localhost:9200/rollup-test-index/_search +### +GET localhost:9200/_cat/indices +### +GET localhost:9200/kibana_sample*/_search +### +PUT localhost:9200/kibana_sample_dummy +### +POST localhost:9200/kibana_sample_*/_search +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "city": { + "terms": { + "field": "geoip.city_name", + "size": 5, + "order": {"total_sales": "desc"} + }, + "aggs": { + "total_sales": { + "sum": { + "field": "taxless_total_price" + } + } + } + } + } +} +### +POST localhost:9200/rollup*/_search +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "city": { + "terms": { + "field": "customer_gender", + "size": 5, + "order": {"max_quantity": "desc"} + }, + "aggs": { + "max_quantity": { + "max": { + "field": "total_quantity" + } + } + } + } + } +} +### +PUT localhost:9200/_cluster/settings +Content-Type: application/json + +{ + "persistent": { + "opendistro.rollup.search.enabled": false + } +} +### +POST localhost:9200/rollup-test-index/_search +Content-Type: application/json + +{ + "size": 10, + "query": { "match_all": {} } +} +### +POST localhost:9200/rollup-test-index/_search +Content-Type: application/json + +{ + "_source": { "includes": "total_quantity"}, + "size": 10, + "query": { "bool": { "filter": [ + {"term": { "customer_gender.terms": "MALE" } }, + {"term": { "customer_gender.terms": "MALE" } } + ]}}, + "sort": {"total_quantity.max": "desc" } +} +### +POST localhost:9200/kibana*/_search +Content-Type: application/json + +{ + "size": 10, + "query": { "term": { "customer_gender": "MALE" } }, + "sort": {"total_quantity": "desc" } +} +### +GET localhost:9200/rollup-test-index/_mappings?pretty +### +POST localhost:9200/rollup-test-inde*/_search +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "city": { + "terms": { + "field": "geoip.city_name", + "size": 5, + "order": {"total_sales": "desc"} + }, + "aggs": { + "total_sales": { + "max": { + "field": "taxless_total_price" + } + } + } + } + } +} +### +DELETE localhost:9200/rollup-test-index +### +PUT localhost:9200/rollup-test-index +Content-Type: application/json + +{ + "mappings": { + "_meta" : { + "schema_version": 1, + "rollups": { + "something": {} + } + }, + "dynamic_templates" : [ + { + "strings" : { + "match_mapping_type" : "string", + "mapping" : { + "type" : "keyword" + } + } + }, + { + "date_histograms" : { + "path_match" : "*.date_histogram.*", + "mapping" : { + "type" : "date" + } + } + } + ] + }, + "settings": { + "index.opendistro.rollup_index": true + } +} + +### +GET localhost:9200/.opendistro-ism-config/_search?pretty \ No newline at end of file diff --git a/worksheets/rollups/secured/nyc.http b/worksheets/rollups/secured/nyc.http new file mode 100644 index 000000000..2a87d7432 --- /dev/null +++ b/worksheets/rollups/secured/nyc.http @@ -0,0 +1,25 @@ +### Create these mappings first if you want to have the date mapping correctly created for datetime fields +PUT https://localhost:9200/nyc-taxi-data +Authorization: Basic admin admin +Content-Type: application/json + +{ + "mappings": { + "properties":{"DOLocationID":{"type":"integer"},"RatecodeID":{"type":"integer"},"fare_amount":{"type":"float"},"tpep_dropoff_datetime":{"type":"date","format":"yyyy-MM-dd HH:mm:ss"},"congestion_surcharge":{"type":"float"},"VendorID":{"type":"integer"},"passenger_count":{"type":"integer"},"tolls_amount":{"type":"float"},"improvement_surcharge":{"type":"float"},"trip_distance":{"type":"float"},"store_and_fwd_flag":{"type":"keyword"},"payment_type":{"type":"integer"},"total_amount":{"type":"float"},"extra":{"type":"float"},"tip_amount":{"type":"float"},"mta_tax":{"type":"float"},"tpep_pickup_datetime":{"type":"date","format":"yyyy-MM-dd HH:mm:ss"},"PULocationID":{"type":"integer"}} + } +} + +### +POST https://localhost:9200/nyc-taxi-data/_bulk?pretty +Authorization: Basic admin admin +Content-Type: application/x-ndjson + +< ../../src/test/resources/data/nyc_5000.ndjson + +### +DELETE https://localhost:9200/nyc-taxi-data/ +Authorization: Basic admin admin + +### +GET https://localhost:9200/nyc-taxi-data/_mapping +Authorization: Basic admin admin \ No newline at end of file diff --git a/worksheets/rollups/secured/security_calls.http b/worksheets/rollups/secured/security_calls.http new file mode 100644 index 000000000..7d569ed3c --- /dev/null +++ b/worksheets/rollups/secured/security_calls.http @@ -0,0 +1,82 @@ +### +PUT https://localhost:9200/_opendistro/_rollup/jobs/bob +Authorization: Basic bob bob +Content-Type: application/json + +{ + "rollup": { + "enabled": true, + "schedule": { + "interval": { + "period": 1, + "unit": "Minutes", + "start_time": {{$timestamp}} + } + }, + "last_updated_time": {{$timestamp}}, + "description": "An example policy that rolls up the sample ecommerce data", + "source_index": "nyc-taxi-data", + "target_index": "example-rollup-index", + "page_size": 5, + "delay": 0, + "roles": ["rollup_all", "nyc_taxi_all", "example_rollup_index_all"], + "continuous": false, + "dimensions": [ + { + "date_histogram": { + "source_field": "tpep_pickup_datetime", + "fixed_interval": "30m", + "timezone": "America/Los_Angeles" + } + }, + { + "terms": { + "source_field": "PULocationID" + } + }, + { + "terms": { + "source_field": "DOLocationID" + } + }, + { + "terms": { + "source_field": "passenger_count" + } + }, + { + "terms": { + "source_field": "VendorID" + } + } + ], + "metrics": [ + { + "source_field": "passenger_count", + "metrics": [{ "avg": {} },{ "sum": {} }, { "max": {} }, { "min": {} }, { "value_count": {} }] + }, + { + "source_field": "trip_distance", + "metrics": [{ "avg": {} },{ "sum": {} }, { "max": {} }, { "min": {} }, { "value_count": {} }] + }, + { + "source_field": "total_amount", + "metrics": [{ "avg": {} },{ "sum": {} }, { "max": {} }, { "min": {} }, { "value_count": {} }] + } + ] + } +} + +### +POST https://localhost:9200/_opendistro/_rollup/jobs/bob/_start +Authorization: Basic bob bob + +### +POST https://localhost:9200/_opendistro/_rollup/jobs/bob/_stop +Authorization: Basic bob_startstop bob_startstop + +### + +GET https://localhost:9200/_search +Authorization: Basic admin admins +Content-Type: application/json \ No newline at end of file diff --git a/worksheets/rollups/secured/security_setup.http b/worksheets/rollups/secured/security_setup.http new file mode 100644 index 000000000..85166daed --- /dev/null +++ b/worksheets/rollups/secured/security_setup.http @@ -0,0 +1,204 @@ +### +PUT https://localhost:9200/_opendistro/_security/api/actiongroups/rollup_all +Authorization: Basic admin admin +Content-Type: application/json + +{ + "allowed_actions": [ + "cluster:admin/opendistro/rollup/index", + "cluster:admin/opendistro/rollup/delete", + "cluster:admin/opendistro/rollup/explain", + "cluster:admin/opendistro/rollup/get", + "cluster:admin/opendistro/rollup/start", + "cluster:admin/opendistro/rollup/stop" + ] +} + +### +PUT https://localhost:9200/_opendistro/_security/api/actiongroups/rollup_read +Authorization: Basic admin admin +Content-Type: application/json + +{ + "allowed_actions": [ + "cluster:admin/opendistro/rollup/explain", + "cluster:admin/opendistro/rollup/get" + ] +} + +### +PUT https://localhost:9200/_opendistro/_security/api/actiongroups/rollup_write +Authorization: Basic admin admin +Content-Type: application/json + +{ + "allowed_actions": [ + "cluster:admin/opendistro/rollup/index", + "cluster:admin/opendistro/rollup/start", + "cluster:admin/opendistro/rollup/stop" + ] +} + +### +PUT https://localhost:9200/_opendistro/_security/api/actiongroups/rollup_startstop +Authorization: Basic admin admin +Content-Type: application/json + +{ + "allowed_actions": [ + "cluster:admin/opendistro/rollup/start", + "cluster:admin/opendistro/rollup/stop" + ] +} + +### +PUT https://localhost:9200/_opendistro/_security/api/internalusers/bob +Authorization: Basic admin admin +Content-Type: application/json + +{ "password": "bob", "backend_roles": ["doesnt_exist"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/internalusers/bob_read +Authorization: Basic admin admin +Content-Type: application/json + +{ "password": "bob_read" } + +### +PUT https://localhost:9200/_opendistro/_security/api/internalusers/bob_write +Authorization: Basic admin admin +Content-Type: application/json + +{ "password": "bob_write" } + +### +PUT https://localhost:9200/_opendistro/_security/api/internalusers/bob_startstop +Authorization: Basic admin admin +Content-Type: application/json + +{ "password": "bob_startstop" } + +### +PUT https://localhost:9200/_opendistro/_security/api/internalusers/bob_rollupall_nycall_readexample +Authorization: Basic admin admin +Content-Type: application/json + +{ "password": "bob_rollupall_nycall_readexample" } + +### +PUT https://localhost:9200/_opendistro/_security/api/roles/rollup_all +Authorization: Basic admin admin +Content-Type: application/json + +{ "cluster_permissions": ["rollup_all"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/roles/rollup_read +Authorization: Basic admin admin +Content-Type: application/json + +{ "cluster_permissions": ["rollup_read"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/roles/rollup_write +Authorization: Basic admin admin +Content-Type: application/json + +{ "cluster_permissions": ["rollup_write"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/roles/rollup_startstop +Authorization: Basic admin admin +Content-Type: application/json + +{ "cluster_permissions": ["rollup_startstop"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/roles/nyc_taxi_all +Authorization: Basic admin admin +Content-Type: application/json + +{ "index_permissions": [{ "index_patterns": ["nyc-taxi-data"], "allowed_actions": ["indices_all"] }] } + +### +PUT https://localhost:9200/_opendistro/_security/api/roles/example_rollup_index_all +Authorization: Basic admin admin +Content-Type: application/json + +{ "index_permissions": [{ "index_patterns": ["example-rollup-index"], "allowed_actions": ["indices_all", "indices:data/write/bulk"] }] } + +### +PUT https://localhost:9200/_opendistro/_security/api/roles/example_rollup_index_read +Authorization: Basic admin admin +Content-Type: application/json + +{ "index_permissions": [{ "index_patterns": ["example-rollup-index"], "allowed_actions": ["read"] }] } + +### +PUT https://localhost:9200/_opendistro/_security/api/roles/fake +Authorization: Basic admin admin +Content-Type: application/json + +{ "cluster_permissions": [] } + +### +PUT https://localhost:9200/_opendistro/_security/api/rolesmapping/rollup_all +Authorization: Basic admin admin +Content-Type: application/json + +{ "users": ["bob"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/rolesmapping/fake +Authorization: Basic admin admin +Content-Type: application/json + +{ "backend_roles": ["doesnt_exist"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/rolesmapping/rollup_read +Authorization: Basic admin admin +Content-Type: application/json + +{ "users": ["bob_read"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/rolesmapping/rollup_write +Authorization: Basic admin admin +Content-Type: application/json + +{ "users": ["bob_write"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/rolesmapping/rollup_startstop +Authorization: Basic admin admin +Content-Type: application/json + +{ "users": ["bob_startstop"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/rolesmapping/nyc_taxi_all +Authorization: Basic admin admin +Content-Type: application/json + +{ "users": ["bob", "bob_rollupall_nycall_readexample"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/rolesmapping/example_rollup_index_all +Authorization: Basic admin admin +Content-Type: application/json + +{ "users": ["bob"] } + +### +PUT https://localhost:9200/_opendistro/_security/api/rolesmapping/example_rollup_index_read +Authorization: Basic admin admin +Content-Type: application/json + +{ "users": ["bob", "bob_rollupall_nycall_readexample"] } + +### +GET https://localhost:9200/_opendistro/_security/api/internalusers +Authorization: Basic admin admin +Content-Type: application/json diff --git a/worksheets/rollups/unsecured/nyc.http b/worksheets/rollups/unsecured/nyc.http new file mode 100644 index 000000000..72000e508 --- /dev/null +++ b/worksheets/rollups/unsecured/nyc.http @@ -0,0 +1,21 @@ +### +PUT localhost:9200/nyc-taxi-data +Content-Type: application/json + +{ + "mappings": { + "properties":{"DOLocationID":{"type":"integer"},"RatecodeID":{"type":"integer"},"fare_amount":{"type":"float"},"tpep_dropoff_datetime":{"type":"date","format":"yyyy-MM-dd HH:mm:ss"},"congestion_surcharge":{"type":"float"},"VendorID":{"type":"integer"},"passenger_count":{"type":"integer"},"tolls_amount":{"type":"float"},"improvement_surcharge":{"type":"float"},"trip_distance":{"type":"float"},"store_and_fwd_flag":{"type":"keyword"},"payment_type":{"type":"integer"},"total_amount":{"type":"float"},"extra":{"type":"float"},"tip_amount":{"type":"float"},"mta_tax":{"type":"float"},"tpep_pickup_datetime":{"type":"date","format":"yyyy-MM-dd HH:mm:ss"},"PULocationID":{"type":"integer"}} + } +} + +### +POST localhost:9200/nyc-taxi-data/_bulk?pretty +Content-Type: application/x-ndjson + +< ../../src/test/resources/data/nyc_5000.ndjson + +### +DELETE localhost:9200/nyc-taxi-data/ + +### +GET localhost:9200/nyc-taxi-data/_mapping \ No newline at end of file