Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Kylin increments build through API

Shulou Source: shulou.com Published: 2022-06-03 05:20:36 11月12日 Update

Official documentation reference: http://kylin.apache.org/cn/docs21/howto/howto_build_cube_with_restapi.html (not detailed)

Account: the default account we use: ADMIN/KYLIN 's basic authentication code is: QURNSU46S1lMSU4=

The format is as follows:

Curl-X PUT-H "Authorization: Basic QURNSU46S1lMSU4="-H 'Content-Type: application/json'-d' {"endTime":'$endTime', "buildType": "BUILD"} 'http:/$host:7070/kylin/api/cubes/$ (cube_name) / rebuild

My script:

'#! / bin/bash

KylinMinusTime=$ ((8 60 60 1000)) # milliseconds corresponding to 8 hours. Here is the utc time, which takes + 8 hours.

Today=date-d now +% Y-%m-%d

TodayTimeStamp=date-d "$today 00:00:00" + s

TodayTimeStampMs=$ (($todayTimeStamp1000 + date "+% N" / 1000000)) # converts current to a timestamp, accurate to milliseconds

EndTime=$ (($todayTimeStampMs+$kylinMinusTime))

Curl-X PUT-H "Authorization: Basic QURNSU46S1lMSU4="-H 'Content-Type: application/json'-d' {"endTime":'$endTime', "buildType": "BUILD"} 'http://stream5:7070/kylin/api/cubes/campaignCube/rebuild

Curl-X PUT-H "Authorization: Basic QURNSU46S1lMSU4="-H 'Content-Type: application/json'-d' {"endTime":'$endTime', "buildType": "BUILD"} 'http://stream5:7070/kylin/api/cubes/salesCube/rebuild

Curl-X PUT-H "Authorization: Basic QURNSU46S1lMSU4="-H 'Content-Type: application/json'-d' {"endTime":'$endTime', "buildType": "BUILD"} 'http://stream5:7070/kylin/api/cubes/marketingCube/rebuild

Tags: Hour time account precision official document format script reference authentication increment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi NVidia Huawei Shulou Technology OPPO Reno