Skip to content

Commit

Permalink
[8.6] Create Integrations page for Elasticsearch clients (#145165) (#…
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
kibanamachine and miriam-eid authored Nov 17, 2022
1 parent b177c88 commit 0aa5dce
Show file tree
Hide file tree
Showing 9 changed files with 954 additions and 20 deletions.
20 changes: 10 additions & 10 deletions src/plugins/custom_integrations/common/language_integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export const languageIntegrations: LanguageIntegration[] = [
description: i18n.translate('customIntegrations.languageclients.RubyDescription', {
defaultMessage: 'Index data to Elasticsearch with the Ruby client.',
}),
docUrlTemplate: `${ELASTICSEARCH_CLIENT_URL}/ruby-api/{branch}/ruby_client.html`,
docUrlTemplate: '',
integrationsAppUrl: `/app/integrations/language_clients/ruby/overview`,
exportLanguageUiComponent: false,
exportLanguageUiComponent: true,
},
{
id: 'go',
Expand All @@ -63,9 +63,9 @@ export const languageIntegrations: LanguageIntegration[] = [
description: i18n.translate('customIntegrations.languageclients.GoDescription', {
defaultMessage: 'Index data to Elasticsearch with the Go client.',
}),
docUrlTemplate: '',
integrationsAppUrl: `/app/integrations/language_clients/go/overview`,
docUrlTemplate: `${ELASTICSEARCH_CLIENT_URL}/go-api/{branch}/overview.html`,
exportLanguageUiComponent: false,
exportLanguageUiComponent: true,
},
{
id: 'dotnet',
Expand All @@ -76,9 +76,9 @@ export const languageIntegrations: LanguageIntegration[] = [
description: i18n.translate('customIntegrations.languageclients.DotNetDescription', {
defaultMessage: 'Index data to Elasticsearch with the .NET client.',
}),
docUrlTemplate: `${ELASTICSEARCH_CLIENT_URL}/net-api/{branch}/index.html`,
docUrlTemplate: '',
integrationsAppUrl: `/app/integrations/language_clients/dotnet/overview`,
exportLanguageUiComponent: false,
exportLanguageUiComponent: true,
},
{
id: 'php',
Expand All @@ -89,9 +89,9 @@ export const languageIntegrations: LanguageIntegration[] = [
description: i18n.translate('customIntegrations.languageclients.PhpDescription', {
defaultMessage: 'Index data to Elasticsearch with the PHP client.',
}),
docUrlTemplate: `${ELASTICSEARCH_CLIENT_URL}/php-api/{branch}/index.html`,
docUrlTemplate: '',
integrationsAppUrl: `/app/integrations/language_clients/php/overview`,
exportLanguageUiComponent: false,
exportLanguageUiComponent: true,
},
{
id: 'perl',
Expand Down Expand Up @@ -141,9 +141,9 @@ export const languageIntegrations: LanguageIntegration[] = [
description: i18n.translate('customIntegrations.languageclients.JavaDescription', {
defaultMessage: 'Index data to Elasticsearch with the Java client.',
}),
docUrlTemplate: `${ELASTICSEARCH_CLIENT_URL}/java-api-client/{branch}/index.html`,
docUrlTemplate: '',
integrationsAppUrl: `/app/integrations/language_clients/java/overview`,
exportLanguageUiComponent: false,
exportLanguageUiComponent: true,
},
// Uncomment to show the sample language client card + README UI
// {
Expand Down
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>
</>
);
};
Loading

0 comments on commit 0aa5dce

Please sign in to comment.