Skip to content

Commit

Permalink
Use dev url for service (elastic#123148)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 authored Jan 17, 2022
1 parent c4b4cf1 commit 70e1153
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions x-pack/plugins/uptime/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const serviceConfig = schema.object({
hosts: schema.maybe(schema.arrayOf(schema.string())),
syncInterval: schema.maybe(schema.string()),
tls: schema.maybe(sslSchema),
devUrl: schema.maybe(schema.string()),
});

const uptimeConfig = schema.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ export interface ServiceData {

export class ServiceAPIClient {
private readonly username?: string;
private readonly devUrl?: string;
private readonly authorization: string;
private locations: ServiceLocations;
private logger: Logger;
private readonly config: ServiceConfig;

constructor(logger: Logger, config: ServiceConfig) {
this.config = config;
const { username, password, manifestUrl } = config;
const { username, password, manifestUrl, devUrl } = config;
this.username = username;
this.devUrl = devUrl;

if (username && password) {
this.authorization = 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64');
Expand Down Expand Up @@ -91,7 +93,7 @@ export class ServiceAPIClient {

return axios({
method,
url: url + '/monitors',
url: (this.devUrl ?? url) + '/monitors',
data: { monitors: monitorsStreams, output },
headers: this.authorization
? {
Expand Down

0 comments on commit 70e1153

Please sign in to comment.