Method: Common::Utils#get_project_id
- Defined in:
- lib/fluent/plugin/common.rb
permalink #get_project_id(platform, project_id) ⇒ Object
-
Return the value if it is explicitly set in the config already.
-
If not, try to retrieve it by calling metadata server directly.
-
If still not set, try to obtain it from the credentials.
174 175 176 177 178 179 |
# File 'lib/fluent/plugin/common.rb', line 174 def get_project_id(platform, project_id) project_id ||= CredentialsInfo.project_id project_id ||= (platform, 'project/project-id') if platform == Platform::GCE project_id end |