-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…145570) # Backport This will backport the following commits from `main` to `8.6`: - [Create Integrations page for Elasticsearch clients (#145165)](#145165) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Miriam Eid","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-11-17T13:48:29Z","message":"Create Integrations page for Elasticsearch clients (#145165)","sha":"e1150a107b67b048672cc9f1d8ae473202ffa467","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","v8.6.0","v8.7.0"],"number":145165,"url":"https://github.com/elastic/kibana/pull/145165","mergeCommit":{"message":"Create Integrations page for Elasticsearch clients (#145165)","sha":"e1150a107b67b048672cc9f1d8ae473202ffa467"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145165","number":145165,"mergeCommit":{"message":"Create Integrations page for Elasticsearch clients (#145165)","sha":"e1150a107b67b048672cc9f1d8ae473202ffa467"}}]}] BACKPORT--> Co-authored-by: Miriam Eid <[email protected]>
- Loading branch information
1 parent
b177c88
commit 0aa5dce
Showing
9 changed files
with
954 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
182 changes: 182 additions & 0 deletions
182
.../public/components/fleet_integration/elasticsearch_dotnet/elasticsearch_dotnet_readme.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
// eslint-disable-next-line @kbn/eslint/module_migration | ||
import styled from 'styled-components'; | ||
|
||
import { | ||
EuiCode, | ||
EuiCodeBlock, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiPage, | ||
EuiPageBody, | ||
EuiPageHeader, | ||
EuiPageSection, | ||
EuiSpacer, | ||
EuiText, | ||
EuiTitle, | ||
EuiPanel, | ||
EuiImage, | ||
} from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { euiThemeVars } from '@kbn/ui-theme'; | ||
import icon from '../../../assets/language_clients/dotnet.svg'; | ||
|
||
const CenterColumn = styled(EuiFlexItem)` | ||
max-width: 740px; | ||
`; | ||
|
||
const FixedHeader = styled.div` | ||
width: 100%; | ||
height: 196px; | ||
border-bottom: 1px solid ${euiThemeVars.euiColorLightShade}; | ||
`; | ||
|
||
const IconPanel = styled(EuiPanel)` | ||
padding: ${(props) => props.theme.eui.euiSizeXL}; | ||
width: ${(props) => | ||
parseFloat(props.theme.eui.euiSize) * 6 + parseFloat(props.theme.eui.euiSizeXL) * 2}px; | ||
svg, | ||
img { | ||
height: ${(props) => parseFloat(props.theme.eui.euiSize) * 6}px; | ||
width: ${(props) => parseFloat(props.theme.eui.euiSize) * 6}px; | ||
} | ||
.euiFlexItem { | ||
height: ${(props) => parseFloat(props.theme.eui.euiSize) * 6}px; | ||
justify-content: center; | ||
} | ||
`; | ||
|
||
const TopFlexGroup = styled(EuiFlexGroup)` | ||
max-width: 1150px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
padding: calc(${euiThemeVars.euiSizeXL} * 2) ${euiThemeVars.euiSizeM} 0 ${euiThemeVars.euiSizeM}; | ||
`; | ||
|
||
export const ElasticsearchDotnetClientReadme = () => { | ||
return ( | ||
<> | ||
<FixedHeader> | ||
<TopFlexGroup alignItems="center" justifyContent="flexStart"> | ||
<EuiFlexItem grow={false}> | ||
<IconPanel> | ||
<EuiImage size="fullWidth" src={icon} alt="icon" /> | ||
</IconPanel> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiTitle size="l"> | ||
<h1> | ||
<FormattedMessage | ||
id="customIntegrations.languageClients.DotnetElasticsearch.readme.title" | ||
defaultMessage="Elasticsearch .NET Client" | ||
/> | ||
</h1> | ||
</EuiTitle> | ||
</EuiFlexItem> | ||
</TopFlexGroup> | ||
</FixedHeader> | ||
|
||
<EuiFlexGroup alignItems="flexStart" justifyContent="center"> | ||
<CenterColumn> | ||
<EuiPage paddingSize="m"> | ||
<EuiPageBody panelled> | ||
<EuiPageSection> | ||
<EuiPageHeader | ||
description={ | ||
<EuiText> | ||
<FormattedMessage | ||
id="customIntegrations.languageClients.DotnetElasticsearch.readme.intro" | ||
defaultMessage="Getting started with the Elasticsearch .NET Client requires a few steps." | ||
/> | ||
</EuiText> | ||
} | ||
/> | ||
</EuiPageSection> | ||
|
||
<EuiPageSection> | ||
<EuiTitle> | ||
<h2> | ||
<FormattedMessage | ||
id="customIntegrations.languageClients.DotnetElasticsearch.readme.install" | ||
defaultMessage="Install the Elasticsearch .NET Client" | ||
/> | ||
</h2> | ||
</EuiTitle> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiText> | ||
<FormattedMessage | ||
id="customIntegrations.languageClients.DotnetElasticsearch.readme.sdk" | ||
defaultMessage="For SDK style projects, you can install the Elasticsearch client by running the following .NET CLI command in your terminal:" | ||
/> | ||
</EuiText> | ||
|
||
<EuiCodeBlock language="shell" isCopyable> | ||
{`$ redotnet add package Elastic.Clients.Elasticsearch --prerelease`} | ||
</EuiCodeBlock> | ||
|
||
<EuiText> | ||
<FormattedMessage | ||
id="customIntegrations.languageClients.DotnetElasticsearch.readme.manually" | ||
defaultMessage="Or, you can manually add a package reference inside your project file:" | ||
/> | ||
</EuiText> | ||
|
||
<EuiCodeBlock language=".dotnet" isCopyable> | ||
{`<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.0.0-alpha.5" />`} | ||
</EuiCodeBlock> | ||
</EuiPageSection> | ||
|
||
<EuiPageSection> | ||
<EuiTitle> | ||
<h2> | ||
<FormattedMessage | ||
id="customIntegrations.languageClients.DotnetElasticsearch.readme.connecting" | ||
defaultMessage="Connecting to Elastic cloud" | ||
/> | ||
</h2> | ||
</EuiTitle> | ||
|
||
<EuiText> | ||
<FormattedMessage | ||
id="customIntegrations.languageClients.DotnetElasticsearch.readme.connectingText" | ||
defaultMessage="You can connect to Elastic Cloud using an {api_key} and a {cloud_id}:" | ||
values={{ | ||
api_key: <EuiCode>API key</EuiCode>, | ||
cloud_id: <EuiCode>Cloud ID</EuiCode>, | ||
}} | ||
/> | ||
</EuiText> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiCodeBlock isCopyable language="dotnet"> | ||
{` | ||
// CLOUD_ID found in the 'Manage this deployment' page | ||
// API_KEY found in the 'Management' page under the section 'Security' | ||
using Elastic.Clients.Elasticsearch; | ||
using Elastic.Transport; | ||
var client = new ElasticsearchClient("<CLOUD_ID>", new ApiKey("<API_KEY>")); | ||
`} | ||
</EuiCodeBlock> | ||
</EuiPageSection> | ||
</EuiPageBody> | ||
</EuiPage> | ||
</CenterColumn> | ||
</EuiFlexGroup> | ||
</> | ||
); | ||
}; |
Oops, something went wrong.