1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.tradefed.cluster; 17 18 import com.android.tradefed.util.MultiMap; 19 import java.io.File; 20 import java.util.List; 21 import java.util.Map; 22 23 /** An interface for getting cluster-related options. */ 24 public interface IClusterOptions { 25 26 /** Get the base url of the tradefed cluster REST API. */ getServiceUrl()27 public String getServiceUrl(); 28 29 /** Get the cluster id for this TF instance. */ getClusterId()30 public String getClusterId(); 31 32 /** Get the secondary cluster ids for this TF instance. */ getNextClusterIds()33 public List<String> getNextClusterIds(); 34 35 /** Get the device group to device mapping. */ getDeviceGroup()36 public MultiMap<String, String> getDeviceGroup(); 37 38 /** Get the device serial to tag mapping. */ getDeviceTag()39 public Map<String, String> getDeviceTag(); 40 41 /** Check if it should check for available flashing permits before leasing. */ checkFlashingPermitsOnLease()42 boolean checkFlashingPermitsOnLease(); 43 44 /** Get the format for labelling run targets. */ getRunTargetFormat()45 public String getRunTargetFormat(); 46 47 /** Returns whether Cluster device reporting is disabled. */ isDeviceMonitorDisabled()48 public boolean isDeviceMonitorDisabled(); 49 50 /** Get the time interval between each device snapshot in ms. */ getDeviceMonitorSnapshotInterval()51 public long getDeviceMonitorSnapshotInterval(); 52 53 /** Returns whether TF should upload invocation status. */ shouldUploadInvocationStatus()54 public Boolean shouldUploadInvocationStatus(); 55 56 /** Get the time interval between invocation heartbeats in ms. */ getInvocationHeartbeatInterval()57 public long getInvocationHeartbeatInterval(); 58 59 /** Get http connect timeout. */ getConnectTimeout()60 public int getConnectTimeout(); 61 62 /** Get http read timeout. */ getReadTimeout()63 public int getReadTimeout(); 64 65 /** Get the tradefed test scheduler service account key file. */ getSchedulerServiceAccountKeyfile()66 public File getSchedulerServiceAccountKeyfile(); 67 68 /** Get the tradefed test scheduler service URL. */ getSchedulerServiceUrl()69 public String getSchedulerServiceUrl(); 70 71 /** Whether the command state (on the TF cluster) should be checked during heartbeat. */ checkCommandState()72 public boolean checkCommandState(); 73 74 /** Get the name of the lab the host belong to. */ getLabName()75 public String getLabName(); 76 77 /** Get labels for the host. */ getLabels()78 public List<String> getLabels(); 79 80 /** Returns whether scheduler should collect early test summary. */ shouldCollectEarlyTestSummary()81 public boolean shouldCollectEarlyTestSummary(); 82 } 83